Browse Source

chore: bump chromium to 76.0.3805.4 (6-0-x) (#18439)

* chore: bump chromium in DEPS to 76.0.3804.1

* chore: update patches

* chore: update v8 patches

* chore: bump chromium in DEPS to 76.0.3805.1

* chore: bump chromium in DEPS to 76.0.3805.2

* chore: bump chromium in DEPS to 76.0.3805.3

* chore: update patches

* Remove content_packaged_services

https://chromium-review.googlesource.com/c/chromium/src/+/1604203

* chore: fix false positive lint error

* views: wireup widget name to crash data

https://chromium-review.googlesource.com/c/chromium/src/+/1626640

* chore: bump chromium in DEPS to 76.0.3805.4
Electron Bot 5 years ago
parent
commit
7b08510075
46 changed files with 216 additions and 2352 deletions
  1. 1 1
      DEPS
  2. 20 4
      atom/app/manifests.cc
  3. 1 1
      atom/app/manifests.h
  4. 6 7
      atom/browser/atom_browser_client.cc
  5. 1 0
      atom/browser/atom_browser_client.h
  6. 1 6
      atom/browser/native_window_views.cc
  7. 11 14
      atom/browser/native_window_views.h
  8. 16 2
      atom/browser/ui/win/atom_desktop_native_widget_aura.cc
  9. 14 2
      atom/browser/ui/win/atom_desktop_native_widget_aura.h
  10. 4 7
      atom/browser/ui/win/atom_desktop_window_tree_host_win.cc
  11. 3 8
      atom/browser/ui/win/atom_desktop_window_tree_host_win.h
  12. 0 16
      atom/browser/ui/win/message_handler_delegate.cc
  13. 0 28
      atom/browser/ui/win/message_handler_delegate.h
  14. 0 2
      filenames.gni
  15. 6 6
      patches/common/chromium/can_create_window.patch
  16. 3 3
      patches/common/chromium/cross_site_document_resource_handler.patch
  17. 1 1
      patches/common/chromium/dcheck.patch
  18. 4 4
      patches/common/chromium/disable-redraw-lock.patch
  19. 3 3
      patches/common/chromium/disable_color_correct_rendering.patch
  20. 1 1
      patches/common/chromium/disable_detach_webview_frame.patch
  21. 3 3
      patches/common/chromium/disable_hidden.patch
  22. 2 2
      patches/common/chromium/disable_user_gesture_requirement_for_beforeunload_dialogs.patch
  23. 2 2
      patches/common/chromium/exclude-a-few-test-files-from-build.patch
  24. 7 7
      patches/common/chromium/frame_host_manager.patch
  25. 18 18
      patches/common/chromium/mas_no_private_api.patch
  26. 2 2
      patches/common/chromium/notification_provenance.patch
  27. 11 11
      patches/common/chromium/printing.patch
  28. 1 1
      patches/common/chromium/render_widget_host_view_mac.patch
  29. 3 3
      patches/common/chromium/resource_file_conflict.patch
  30. 2 2
      patches/common/chromium/scroll_bounce_flag.patch
  31. 5 5
      patches/common/chromium/support_mixed_sandbox_with_zygote.patch
  32. 4 4
      patches/common/chromium/viz_osr.patch
  33. 3 3
      patches/common/chromium/web_contents.patch
  34. 5 5
      patches/common/chromium/worker_context_will_destroy.patch
  35. 0 4
      patches/common/v8/.patches
  36. 2 2
      patches/common/v8/add_realloc.patch
  37. 3 3
      patches/common/v8/build_gn.patch
  38. 4 4
      patches/common/v8/dcheck.patch
  39. 34 34
      patches/common/v8/deps_provide_more_v8_backwards_compatibility.patch
  40. 6 6
      patches/common/v8/export_symbols_needed_for_windows_build.patch
  41. 2 2
      patches/common/v8/expose_mksnapshot.patch
  42. 0 261
      patches/common/v8/fixme_revert_heap_api_remove_deprecated_apis.patch
  43. 0 142
      patches/common/v8/revert_api_remove_deprecated_conversion_functions.patch
  44. 0 550
      patches/common/v8/revert_cctest_add_v8_export_private_to_arm_arm64_ports.patch
  45. 0 1159
      patches/common/v8/revert_reland_api_heap_remove_deprecated_persistent_apis.patch
  46. 1 1
      patches/common/v8/workaround_an_undefined_symbol_error.patch

+ 1 - 1
DEPS

@@ -10,7 +10,7 @@ gclient_gn_args = [
 
 vars = {
   'chromium_version':
-    '76.0.3803.1',
+    '76.0.3805.4',
   'node_version':
     'a86a4a160dc520c61a602c949a32a1bc4c0fc633',
 

+ 20 - 4
atom/app/manifests.cc

@@ -18,6 +18,22 @@
 #include "chrome/services/printing/public/cpp/manifest.h"
 #endif
 
+namespace {
+
+// TODO(https://crbug.com/781334): Remove these helpers and just update the
+// manifest definitions to be marked out-of-process. This is here only to avoid
+// extra churn when transitioning away from content_packaged_services.
+service_manager::Manifest MakeOutOfProcess(
+    const service_manager::Manifest& manifest) {
+  // cpplint.py emits a false positive [build/include_what_you_use]
+  service_manager::Manifest copy(manifest);  // NOLINT
+  copy.options.execution_mode =
+      service_manager::Manifest::ExecutionMode::kOutOfProcessBuiltin;
+  return copy;
+}
+
+}  // namespace
+
 const service_manager::Manifest& GetElectronContentBrowserOverlayManifest() {
   static base::NoDestructor<service_manager::Manifest> manifest{
       service_manager::ManifestBuilder()
@@ -35,14 +51,14 @@ const service_manager::Manifest& GetElectronContentBrowserOverlayManifest() {
 }
 
 const std::vector<service_manager::Manifest>&
-GetElectronPackagedServicesOverlayManifest() {
+GetElectronBuiltinServiceManifests() {
   static base::NoDestructor<std::vector<service_manager::Manifest>> manifests{{
-      proxy_resolver::GetManifest(),
+      MakeOutOfProcess(proxy_resolver::GetManifest()),
 #if BUILDFLAG(ENABLE_PRINTING)
-      printing::GetPdfCompositorManifest(),
+      MakeOutOfProcess(printing::GetPdfCompositorManifest()),
 #endif
 #if BUILDFLAG(ENABLE_PRINT_PREVIEW)
-      GetChromePrintingManifest(),
+      MakeOutOfProcess(GetChromePrintingManifest()),
 #endif
   }};
   return *manifests;

+ 1 - 1
atom/app/manifests.h

@@ -11,6 +11,6 @@
 
 const service_manager::Manifest& GetElectronContentBrowserOverlayManifest();
 const std::vector<service_manager::Manifest>&
-GetElectronPackagedServicesOverlayManifest();
+GetElectronBuiltinServiceManifests();
 
 #endif  // ATOM_APP_MANIFESTS_H_

+ 6 - 7
atom/browser/atom_browser_client.cc

@@ -724,17 +724,16 @@ void AtomBrowserClient::RegisterOutOfProcessServices(
 
 base::Optional<service_manager::Manifest>
 AtomBrowserClient::GetServiceManifestOverlay(base::StringPiece name) {
-  if (name == content::mojom::kBrowserServiceName) {
+  if (name == content::mojom::kBrowserServiceName)
     return GetElectronContentBrowserOverlayManifest();
-  } else if (name == content::mojom::kPackagedServicesServiceName) {
-    service_manager::Manifest overlay;
-    overlay.packaged_services = GetElectronPackagedServicesOverlayManifest();
-    return overlay;
-  }
-
   return base::nullopt;
 }
 
+std::vector<service_manager::Manifest>
+AtomBrowserClient::GetExtraServiceManifests() {
+  return GetElectronBuiltinServiceManifests();
+}
+
 net::NetLog* AtomBrowserClient::GetNetLog() {
   return g_browser_process->net_log();
 }

+ 1 - 0
atom/browser/atom_browser_client.h

@@ -142,6 +142,7 @@ class AtomBrowserClient : public content::ContentBrowserClient,
   void RegisterOutOfProcessServices(OutOfProcessServiceMap* services) override;
   base::Optional<service_manager::Manifest> GetServiceManifestOverlay(
       base::StringPiece name) override;
+  std::vector<service_manager::Manifest> GetExtraServiceManifests() override;
   net::NetLog* GetNetLog() override;
   content::MediaObserver* GetMediaObserver() override;
   content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() override;

+ 1 - 6
atom/browser/native_window_views.cc

@@ -58,7 +58,6 @@
 #elif defined(OS_WIN)
 #include "atom/browser/ui/views/win_frame_view.h"
 #include "atom/browser/ui/win/atom_desktop_native_widget_aura.h"
-#include "atom/browser/ui/win/atom_desktop_window_tree_host_win.h"
 #include "skia/ext/skia_utils_win.h"
 #include "ui/base/win/shell.h"
 #include "ui/display/screen.h"
@@ -186,11 +185,7 @@ NativeWindowViews::NativeWindowViews(const mate::Dictionary& options,
   if (parent)
     params.parent = parent->GetNativeWindow();
 
-  params.native_widget = new AtomDesktopNativeWidgetAura(widget());
-  atom_desktop_window_tree_host_win_ = new AtomDesktopWindowTreeHostWin(
-      this, widget(),
-      static_cast<views::DesktopNativeWidgetAura*>(params.native_widget));
-  params.desktop_window_tree_host = atom_desktop_window_tree_host_win_;
+  params.native_widget = new AtomDesktopNativeWidgetAura(this);
 #elif defined(USE_X11)
   std::string name = Browser::Get()->GetName();
   // Set WM_WINDOW_ROLE.

+ 11 - 14
atom/browser/native_window_views.h

@@ -15,7 +15,6 @@
 #include "ui/views/widget/widget_observer.h"
 
 #if defined(OS_WIN)
-#include "atom/browser/ui/win/message_handler_delegate.h"
 #include "atom/browser/ui/win/taskbar_host.h"
 #include "base/win/scoped_gdi_object.h"
 #endif
@@ -30,16 +29,11 @@ class GlobalMenuBarX11;
 class RootView;
 class WindowStateWatcher;
 
-#if defined(OS_WIN)
-class AtomDesktopWindowTreeHostWin;
-#elif defined(USE_X11)
+#if defined(USE_X11)
 class EventDisabler;
 #endif
 
 class NativeWindowViews : public NativeWindow,
-#if defined(OS_WIN)
-                          public MessageHandlerDelegate,
-#endif
                           public views::WidgetObserver,
                           public ui::EventHandler {
  public:
@@ -142,6 +136,16 @@ class NativeWindowViews : public NativeWindow,
   void DecrementChildModals();
 
 #if defined(OS_WIN)
+  // Catch-all message handling and filtering. Called before
+  // HWNDMessageHandler's built-in handling, which may pre-empt some
+  // expectations in Views/Aura if messages are consumed. Returns true if the
+  // message was consumed by the delegate and should not be processed further
+  // by the HWNDMessageHandler. In this case, |result| is returned. |result| is
+  // not modified otherwise.
+  bool PreHandleMSG(UINT message,
+                    WPARAM w_param,
+                    LPARAM l_param,
+                    LRESULT* result);
   void SetIcon(HICON small_icon, HICON app_icon);
 #elif defined(USE_X11)
   void SetIcon(const gfx::ImageSkia& icon);
@@ -180,11 +184,6 @@ class NativeWindowViews : public NativeWindow,
 #endif
 
 #if defined(OS_WIN)
-  // MessageHandlerDelegate:
-  bool PreHandleMSG(UINT message,
-                    WPARAM w_param,
-                    LPARAM l_param,
-                    LRESULT* result) override;
   void HandleSizeEvent(WPARAM w_param, LPARAM l_param);
   void SetForwardMouseMessages(bool forward);
   static LRESULT CALLBACK SubclassProc(HWND hwnd,
@@ -237,8 +236,6 @@ class NativeWindowViews : public NativeWindow,
 #endif
 
 #if defined(OS_WIN)
-  // Weak ref.
-  AtomDesktopWindowTreeHostWin* atom_desktop_window_tree_host_win_;
 
   ui::WindowShowState last_window_state_;
 

+ 16 - 2
atom/browser/ui/win/atom_desktop_native_widget_aura.cc

@@ -3,18 +3,32 @@
 // found in the LICENSE file.
 
 #include "atom/browser/ui/win/atom_desktop_native_widget_aura.h"
+
+#include "atom/browser/ui/win/atom_desktop_window_tree_host_win.h"
 #include "ui/views/corewm/tooltip_controller.h"
 #include "ui/wm/public/tooltip_client.h"
 
 namespace atom {
 
 AtomDesktopNativeWidgetAura::AtomDesktopNativeWidgetAura(
-    views::internal::NativeWidgetDelegate* delegate)
-    : views::DesktopNativeWidgetAura(delegate) {
+    NativeWindowViews* native_window_view)
+    : views::DesktopNativeWidgetAura(native_window_view->widget()),
+      native_window_view_(native_window_view) {
+  GetNativeWindow()->SetName("AtomDesktopNativeWidgetAura");
   // This is to enable the override of OnWindowActivated
   wm::SetActivationChangeObserver(GetNativeWindow(), this);
 }
 
+void AtomDesktopNativeWidgetAura::InitNativeWidget(
+    const views::Widget::InitParams& params) {
+  views::Widget::InitParams modified_params = params;
+  desktop_window_tree_host_ = new AtomDesktopWindowTreeHostWin(
+      native_window_view_,
+      static_cast<views::DesktopNativeWidgetAura*>(params.native_widget));
+  modified_params.desktop_window_tree_host = desktop_window_tree_host_;
+  views::DesktopNativeWidgetAura::InitNativeWidget(modified_params);
+}
+
 void AtomDesktopNativeWidgetAura::Activate() {
   // Activate can cause the focused window to be blurred so only
   // call when the window being activated is visible. This prevents

+ 14 - 2
atom/browser/ui/win/atom_desktop_native_widget_aura.h

@@ -8,12 +8,18 @@
 #include "atom/browser/native_window_views.h"
 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
 
+namespace views {
+class DesktopWindowTreeHost;
+}
+
 namespace atom {
 
 class AtomDesktopNativeWidgetAura : public views::DesktopNativeWidgetAura {
  public:
-  explicit AtomDesktopNativeWidgetAura(
-      views::internal::NativeWidgetDelegate* delegate);
+  explicit AtomDesktopNativeWidgetAura(NativeWindowViews* native_window_view);
+
+  // views::DesktopNativeWidgetAura:
+  void InitNativeWidget(const views::Widget::InitParams& params) override;
 
   // internal::NativeWidgetPrivate:
   void Activate() override;
@@ -22,6 +28,12 @@ class AtomDesktopNativeWidgetAura : public views::DesktopNativeWidgetAura {
   void OnWindowActivated(wm::ActivationChangeObserver::ActivationReason reason,
                          aura::Window* gained_active,
                          aura::Window* lost_active) override;
+
+  NativeWindowViews* native_window_view_;
+
+  // Owned by DesktopNativeWidgetAura.
+  views::DesktopWindowTreeHost* desktop_window_tree_host_;
+
   DISALLOW_COPY_AND_ASSIGN(AtomDesktopNativeWidgetAura);
 };
 

+ 4 - 7
atom/browser/ui/win/atom_desktop_window_tree_host_win.cc

@@ -4,17 +4,14 @@
 
 #include "atom/browser/ui/win/atom_desktop_window_tree_host_win.h"
 
-#include "atom/browser/ui/win/message_handler_delegate.h"
-
 namespace atom {
 
 AtomDesktopWindowTreeHostWin::AtomDesktopWindowTreeHostWin(
-    MessageHandlerDelegate* delegate,
-    views::internal::NativeWidgetDelegate* native_widget_delegate,
+    NativeWindowViews* native_window_view,
     views::DesktopNativeWidgetAura* desktop_native_widget_aura)
-    : views::DesktopWindowTreeHostWin(native_widget_delegate,
+    : views::DesktopWindowTreeHostWin(native_window_view->widget(),
                                       desktop_native_widget_aura),
-      delegate_(delegate) {}
+      native_window_view_(native_window_view) {}
 
 AtomDesktopWindowTreeHostWin::~AtomDesktopWindowTreeHostWin() {}
 
@@ -22,7 +19,7 @@ bool AtomDesktopWindowTreeHostWin::PreHandleMSG(UINT message,
                                                 WPARAM w_param,
                                                 LPARAM l_param,
                                                 LRESULT* result) {
-  return delegate_->PreHandleMSG(message, w_param, l_param, result);
+  return native_window_view_->PreHandleMSG(message, w_param, l_param, result);
 }
 
 bool AtomDesktopWindowTreeHostWin::HasNativeFrame() const {

+ 3 - 8
atom/browser/ui/win/atom_desktop_window_tree_host_win.h

@@ -7,20 +7,15 @@
 
 #include <windows.h>
 
-#include <vector>
-
-#include "atom/browser/native_window.h"
+#include "atom/browser/native_window_views.h"
 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_win.h"
 
 namespace atom {
 
-class MessageHandlerDelegate;
-
 class AtomDesktopWindowTreeHostWin : public views::DesktopWindowTreeHostWin {
  public:
   AtomDesktopWindowTreeHostWin(
-      MessageHandlerDelegate* delegate,
-      views::internal::NativeWidgetDelegate* native_widget_delegate,
+      NativeWindowViews* native_window_view,
       views::DesktopNativeWidgetAura* desktop_native_widget_aura);
   ~AtomDesktopWindowTreeHostWin() override;
 
@@ -32,7 +27,7 @@ class AtomDesktopWindowTreeHostWin : public views::DesktopWindowTreeHostWin {
   bool HasNativeFrame() const override;
 
  private:
-  MessageHandlerDelegate* delegate_;  // weak ref
+  NativeWindowViews* native_window_view_;  // weak ref
 
   DISALLOW_COPY_AND_ASSIGN(AtomDesktopWindowTreeHostWin);
 };

+ 0 - 16
atom/browser/ui/win/message_handler_delegate.cc

@@ -1,16 +0,0 @@
-// Copyright (c) 2015 GitHub, Inc.
-// Use of this source code is governed by the MIT license that can be
-// found in the LICENSE file.
-
-#include "atom/browser/ui/win/message_handler_delegate.h"
-
-namespace atom {
-
-bool MessageHandlerDelegate::PreHandleMSG(UINT message,
-                                          WPARAM w_param,
-                                          LPARAM l_param,
-                                          LRESULT* result) {
-  return false;
-}
-
-}  // namespace atom

+ 0 - 28
atom/browser/ui/win/message_handler_delegate.h

@@ -1,28 +0,0 @@
-// Copyright (c) 2015 GitHub, Inc.
-// Use of this source code is governed by the MIT license that can be
-// found in the LICENSE file.
-
-#ifndef ATOM_BROWSER_UI_WIN_MESSAGE_HANDLER_DELEGATE_H_
-#define ATOM_BROWSER_UI_WIN_MESSAGE_HANDLER_DELEGATE_H_
-
-#include <windows.h>
-
-namespace atom {
-
-class MessageHandlerDelegate {
- public:
-  // Catch-all message handling and filtering. Called before
-  // HWNDMessageHandler's built-in handling, which may pre-empt some
-  // expectations in Views/Aura if messages are consumed. Returns true if the
-  // message was consumed by the delegate and should not be processed further
-  // by the HWNDMessageHandler. In this case, |result| is returned. |result| is
-  // not modified otherwise.
-  virtual bool PreHandleMSG(UINT message,
-                            WPARAM w_param,
-                            LPARAM l_param,
-                            LRESULT* result);
-};
-
-}  // namespace atom
-
-#endif  // ATOM_BROWSER_UI_WIN_MESSAGE_HANDLER_DELEGATE_H_

+ 0 - 2
filenames.gni

@@ -499,8 +499,6 @@ filenames = {
     "atom/browser/ui/win/atom_desktop_window_tree_host_win.h",
     "atom/browser/ui/win/jump_list.cc",
     "atom/browser/ui/win/jump_list.h",
-    "atom/browser/ui/win/message_handler_delegate.cc",
-    "atom/browser/ui/win/message_handler_delegate.h",
     "atom/browser/ui/win/notify_icon_host.cc",
     "atom/browser/ui/win/notify_icon_host.h",
     "atom/browser/ui/win/notify_icon.cc",

+ 6 - 6
patches/common/chromium/can_create_window.patch

@@ -5,10 +5,10 @@ Subject: can_create_window.patch
 
 
 diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
-index e3b6bc9ab2b12493daddad8471ac48eb15f878e3..880b8eabb4227c93cf1f920b364709aa64e53bc6 100644
+index c7901db74eb58fb0caf75ce8e1113278aa0063ed..dfe2a45e0b619500406afc46eed5b7ca11cb2fad 100644
 --- a/content/browser/frame_host/render_frame_host_impl.cc
 +++ b/content/browser/frame_host/render_frame_host_impl.cc
-@@ -3722,6 +3722,7 @@ void RenderFrameHostImpl::CreateNewWindow(
+@@ -3712,6 +3712,7 @@ void RenderFrameHostImpl::CreateNewWindow(
            last_committed_origin_, params->window_container_type,
            params->target_url, params->referrer.To<Referrer>(),
            params->frame_name, params->disposition, *params->features,
@@ -32,7 +32,7 @@ index 82882159b0bac6d47d678c485de0aacc7db06c2d..dd2299094b79d82da7ec1cd8f559050b
  
  // Operation result when the renderer asks the browser to create a new window.
 diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
-index da482a1a1638f27a413502d9be16a5fb12e9678c..de19cb3a5f3d6685d8dede7c3cdb5b47183ed07f 100644
+index ce9d0ede84da62061278f7fb0c543fc2e8a0216e..3729dcc9ea3272c943754a92c6ed1d7a1fd8fcf3 100644
 --- a/content/public/browser/content_browser_client.cc
 +++ b/content/public/browser/content_browser_client.cc
 @@ -518,6 +518,8 @@ bool ContentBrowserClient::CanCreateWindow(
@@ -45,17 +45,17 @@ index da482a1a1638f27a413502d9be16a5fb12e9678c..de19cb3a5f3d6685d8dede7c3cdb5b47
      bool opener_suppressed,
      bool* no_javascript_access) {
 diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
-index c11897f6a45a8bf1a80bfb727992087b03904412..13342817ac00282bba5089bafb7e3a1ed85f0b0d 100644
+index 449941ddc4d43dc4cb164f6af9dcc69991dddc8b..4c84fb3648b3de36015b325246559f8aefe2ebd5 100644
 --- a/content/public/browser/content_browser_client.h
 +++ b/content/public/browser/content_browser_client.h
-@@ -175,6 +175,7 @@ class RenderFrameHost;
+@@ -177,6 +177,7 @@ class RenderFrameHost;
  class RenderProcessHost;
  class RenderViewHost;
  class ResourceContext;
 +class ResourceRequestBody;
  class SerialDelegate;
- class ServiceManagerConnection;
  class SiteInstance;
+ class SpeechRecognitionManagerDelegate;
 @@ -802,6 +803,8 @@ class CONTENT_EXPORT ContentBrowserClient {
        const std::string& frame_name,
        WindowOpenDisposition disposition,

+ 3 - 3
patches/common/chromium/cross_site_document_resource_handler.patch

@@ -22,7 +22,7 @@ index 2151c5b9698e9a2768875d04a2297956cc4c0d41..8a316a117ab367bcbac947894cbe1bc2
  }
  
 diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
-index acf458d5c088607d3ceb6d058f28f076bf4cf712..4bdfeefc531b378f33b143ea432aebd69906bf08 100644
+index 2317ddf6a3c533f701fe44bf1b8114eb042c2189..9a823a98175c33c84b8d44a95c9d7d44568807ca 100644
 --- a/content/public/browser/content_browser_client.cc
 +++ b/content/public/browser/content_browser_client.cc
 @@ -61,6 +61,10 @@ ContentBrowserClient::SiteInstanceForNavigationType ContentBrowserClient::Should
@@ -37,10 +37,10 @@ index acf458d5c088607d3ceb6d058f28f076bf4cf712..4bdfeefc531b378f33b143ea432aebd6
      const MainFunctionParams& parameters) {
    return nullptr;
 diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
-index 97ac4f66b6410fbb5596e01ae8152194d4f235c8..54550e2942b176bccafbfde395d9ec4ae9777a4a 100644
+index a81f40507b2233c3bde03b940cccd6be0aaa4926..1a208d24bae80277e4a60f4180bb7f95c38561ce 100644
 --- a/content/public/browser/content_browser_client.h
 +++ b/content/public/browser/content_browser_client.h
-@@ -241,6 +241,9 @@ class CONTENT_EXPORT ContentBrowserClient {
+@@ -242,6 +242,9 @@ class CONTENT_EXPORT ContentBrowserClient {
        content::RenderFrameHost* rfh,
        content::SiteInstance* pending_site_instance) {}
  

+ 1 - 1
patches/common/chromium/dcheck.patch

@@ -17,7 +17,7 @@ only one or two specific checks fail. Then it's better to simply comment out the
 failing checks and allow the rest of the target to have them enabled.
 
 diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
-index d47e3fba4fb3f9048598dd4d56f156ab740fb56c..45656de4dc59038458128882a80e2508c81acb8d 100644
+index 25f8796f96bf176ef4bd222eb2426226b3107c83..8e7765eed9b9f24ddc3cb92e97893ff70dbeb683 100644
 --- a/content/browser/frame_host/navigation_controller_impl.cc
 +++ b/content/browser/frame_host/navigation_controller_impl.cc
 @@ -1242,8 +1242,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation(

+ 4 - 4
patches/common/chromium/disable-redraw-lock.patch

@@ -15,7 +15,7 @@ the redraw locking mechanism, which fixes these issues. The electron issue
 can be found at https://github.com/electron/electron/issues/1821
 
 diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
-index 64dbeec700f4848966cd25940ae1a360de09f1d1..0a92b5d3501682cdd5101e3fdd8dde96580efc92 100644
+index f67479a1f9230f6869c281c884251792bf957cf9..deebf94235041cd439e5b94c81a43aa89b158445 100644
 --- a/ui/views/win/hwnd_message_handler.cc
 +++ b/ui/views/win/hwnd_message_handler.cc
 @@ -285,6 +285,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500;
@@ -37,7 +37,7 @@ index 64dbeec700f4848966cd25940ae1a360de09f1d1..0a92b5d3501682cdd5101e3fdd8dde96
                       (!(GetWindowLong(hwnd_, GWL_STYLE) & WS_CAPTION) ||
                        !ui::win::IsAeroGlassEnabled())) {
      if (should_lock_)
-@@ -934,6 +939,10 @@ bool HWNDMessageHandler::HasChildRenderingWindow() {
+@@ -936,6 +941,10 @@ bool HWNDMessageHandler::HasChildRenderingWindow() {
        hwnd());
  }
  
@@ -49,10 +49,10 @@ index 64dbeec700f4848966cd25940ae1a360de09f1d1..0a92b5d3501682cdd5101e3fdd8dde96
  // HWNDMessageHandler, gfx::WindowImpl overrides:
  
 diff --git a/ui/views/win/hwnd_message_handler.h b/ui/views/win/hwnd_message_handler.h
-index e51d2f358319108e1f5dd70898070caf655265bf..5efcdf139ef331f09f427f75a9a75ed270bcd433 100644
+index 060aa2dc02a27d76005657d92a62b466c07f8fce..6f93c637489e64c2e76b48147fc28063aecbe1c6 100644
 --- a/ui/views/win/hwnd_message_handler.h
 +++ b/ui/views/win/hwnd_message_handler.h
-@@ -189,6 +189,8 @@ class VIEWS_EXPORT HWNDMessageHandler : public gfx::WindowImpl,
+@@ -192,6 +192,8 @@ class VIEWS_EXPORT HWNDMessageHandler : public gfx::WindowImpl,
    using TouchIDs = std::set<DWORD>;
    enum class DwmFrameState { OFF, ON };
  

+ 3 - 3
patches/common/chromium/disable_color_correct_rendering.patch

@@ -215,10 +215,10 @@ index f19bbb46ea6f3962f83d10fb400ae55584a17a9e..c5dff79af54a03ef888e4474e5ea5368
      service_manager::switches::kGpuSandboxAllowSysVShm,
      service_manager::switches::kGpuSandboxFailuresFatal,
 diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
-index 982b82ef2b517bd21f05f24efc8e0d78c111d495..4a32760fc4764341d0c3a4d74b8f9fd044c891e9 100644
+index f58456df8d856346a2350b87ecd84de5b75e0d13..e0b39de61eb43f2ac779e273d3df937e38c201c4 100644
 --- a/content/browser/renderer_host/render_process_host_impl.cc
 +++ b/content/browser/renderer_host/render_process_host_impl.cc
-@@ -218,6 +218,7 @@
+@@ -217,6 +217,7 @@
  #include "ui/base/ui_base_switches.h"
  #include "ui/base/ui_base_switches_util.h"
  #include "ui/display/display_switches.h"
@@ -226,7 +226,7 @@ index 982b82ef2b517bd21f05f24efc8e0d78c111d495..4a32760fc4764341d0c3a4d74b8f9fd0
  #include "ui/gl/gl_switches.h"
  #include "ui/native_theme/native_theme_features.h"
  
-@@ -2925,6 +2926,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
+@@ -2912,6 +2913,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
    // Propagate the following switches to the renderer command line (along
    // with any associated values) if present in the browser command line.
    static const char* const kSwitchNames[] = {

+ 1 - 1
patches/common/chromium/disable_detach_webview_frame.patch

@@ -12,7 +12,7 @@ this patch was introduced in Chrome 66.
 Update(zcbenz): The bug is still in Chrome 72.
 
 diff --git a/content/browser/frame_host/render_frame_proxy_host.cc b/content/browser/frame_host/render_frame_proxy_host.cc
-index 7f0d8867dcf5eeaad3a1294014a141ff52e0643d..fc8b96dfd1c3a6d87ebc2cce1f736735e69743e6 100644
+index 40b42d5c85d693d15aedb6265628fe8da15dae76..1fdf88d06a869da2edad9383456cc89129f7d7cc 100644
 --- a/content/browser/frame_host/render_frame_proxy_host.cc
 +++ b/content/browser/frame_host/render_frame_proxy_host.cc
 @@ -261,6 +261,12 @@ void RenderFrameProxyHost::BubbleLogicalScroll(

+ 3 - 3
patches/common/chromium/disable_hidden.patch

@@ -5,10 +5,10 @@ Subject: disable_hidden.patch
 
 
 diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
-index 525bb5e2a54c60c91ec7b435eb0387393c80a4b5..165e717369f9e218ba476bbecf8f1cd2979c6426 100644
+index bd0343cbb4ba7d91f7541f94d27499b1e1a120e8..e28d6e0077455a461f270988e3c46a89e1c485b2 100644
 --- a/content/browser/renderer_host/render_widget_host_impl.cc
 +++ b/content/browser/renderer_host/render_widget_host_impl.cc
-@@ -736,6 +736,9 @@ void RenderWidgetHostImpl::WasHidden() {
+@@ -672,6 +672,9 @@ void RenderWidgetHostImpl::WasHidden() {
    if (is_hidden_)
      return;
  
@@ -19,7 +19,7 @@ index 525bb5e2a54c60c91ec7b435eb0387393c80a4b5..165e717369f9e218ba476bbecf8f1cd2
  
    TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::WasHidden");
 diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
-index 551ee2b2199d86a200dfed22b5405e40891284d9..1a2c38dc16d4521762d0557b17e07b30b23f5b82 100644
+index 654c60e7bdecf009f2b837e38e9db50f3409978d..65fb1c070196b814edc6d94012150fa496897577 100644
 --- a/content/browser/renderer_host/render_widget_host_impl.h
 +++ b/content/browser/renderer_host/render_widget_host_impl.h
 @@ -155,6 +155,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl

+ 2 - 2
patches/common/chromium/disable_user_gesture_requirement_for_beforeunload_dialogs.patch

@@ -6,10 +6,10 @@ Subject: disable_user_gesture_requirement_for_beforeunload_dialogs.patch
 See https://github.com/electron/electron/issues/10754
 
 diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
-index ac3b425647a55a89c56561b9e878e5784d337a87..cac37fc103cffccf98246f06f5330d3cfa064f46 100644
+index bb3aff0859f1a6998889aa4b3fb2ca1143c0ed24..eb950ec3352634980447b91e46a652a877eb8782 100644
 --- a/third_party/blink/renderer/core/dom/document.cc
 +++ b/third_party/blink/renderer/core/dom/document.cc
-@@ -3651,7 +3651,9 @@ bool Document::DispatchBeforeUnloadEvent(ChromeClient* chrome_client,
+@@ -3649,7 +3649,9 @@ bool Document::DispatchBeforeUnloadEvent(ChromeClient* chrome_client,
          "frame that never had a user gesture since its load. "
          "https://www.chromestatus.com/feature/5082396709879808";
      Intervention::GenerateReport(frame_, "BeforeUnloadNoGesture", message);

+ 2 - 2
patches/common/chromium/exclude-a-few-test-files-from-build.patch

@@ -7,10 +7,10 @@ Compilation of those files fails with the Chromium 68.
 Remove the patch during the Chromium 69 upgrade.
 
 diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn
-index 5a0c974d03b9106d2a41d10de236b6631444e198..8805db465774a292fd8236d345ae9e0cd1640a4f 100644
+index 99269e86e5b60e1191cc4bfef59f8fb3f8cb2f27..0c90eaaaa5b08e33ea7fce212429a4e9f7a49cf5 100644
 --- a/third_party/blink/renderer/platform/BUILD.gn
 +++ b/third_party/blink/renderer/platform/BUILD.gn
-@@ -1755,7 +1755,7 @@ jumbo_source_set("blink_platform_unittests_sources") {
+@@ -1749,7 +1749,7 @@ jumbo_source_set("blink_platform_unittests_sources") {
      "graphics/paint/drawing_display_item_test.cc",
      "graphics/paint/drawing_recorder_test.cc",
      "graphics/paint/float_clip_rect_test.cc",

+ 7 - 7
patches/common/chromium/frame_host_manager.patch

@@ -7,10 +7,10 @@ Allows embedder to intercept site instances chosen by chromium
 and respond with custom instance.
 
 diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
-index ce9c79b32823b5f6f7edfdc14112bb1ed70e98ba..0708e35ff066b793121862a755081b2db2aad086 100644
+index b5301d164138f21ca8ae01abfb153efde51ec324..91efc5f94f61f7bccc2ff802851097df8eb52818 100644
 --- a/content/browser/frame_host/render_frame_host_manager.cc
 +++ b/content/browser/frame_host/render_frame_host_manager.cc
-@@ -2141,6 +2141,16 @@ bool RenderFrameHostManager::InitRenderView(
+@@ -2127,6 +2127,16 @@ bool RenderFrameHostManager::InitRenderView(
  scoped_refptr<SiteInstance>
  RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
      const NavigationRequest& request) {
@@ -27,7 +27,7 @@ index ce9c79b32823b5f6f7edfdc14112bb1ed70e98ba..0708e35ff066b793121862a755081b2d
    // First, check if the navigation can switch SiteInstances. If not, the
    // navigation should use the current SiteInstance.
    SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance();
-@@ -2173,6 +2183,51 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
+@@ -2159,6 +2169,51 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
                                                request.common_params().url);
      no_renderer_swap_allowed |=
          request.from_begin_navigation() && !can_renderer_initiate_transfer;
@@ -79,7 +79,7 @@ index ce9c79b32823b5f6f7edfdc14112bb1ed70e98ba..0708e35ff066b793121862a755081b2d
    } else {
      // Subframe navigations will use the current renderer, unless specifically
      // allowed to swap processes.
-@@ -2184,23 +2239,17 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
+@@ -2170,23 +2225,17 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
    if (no_renderer_swap_allowed && !should_swap_for_error_isolation)
      return scoped_refptr<SiteInstance>(current_site_instance);
  
@@ -108,7 +108,7 @@ index ce9c79b32823b5f6f7edfdc14112bb1ed70e98ba..0708e35ff066b793121862a755081b2d
  }
  
 diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
-index de19cb3a5f3d6685d8dede7c3cdb5b47183ed07f..acf458d5c088607d3ceb6d058f28f076bf4cf712 100644
+index 3729dcc9ea3272c943754a92c6ed1d7a1fd8fcf3..2317ddf6a3c533f701fe44bf1b8114eb042c2189 100644
 --- a/content/public/browser/content_browser_client.cc
 +++ b/content/public/browser/content_browser_client.cc
 @@ -51,6 +51,16 @@ void OverrideOnBindInterface(const service_manager::BindSourceInfo& remote_info,
@@ -129,10 +129,10 @@ index de19cb3a5f3d6685d8dede7c3cdb5b47183ed07f..acf458d5c088607d3ceb6d058f28f076
      const MainFunctionParams& parameters) {
    return nullptr;
 diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
-index 13342817ac00282bba5089bafb7e3a1ed85f0b0d..97ac4f66b6410fbb5596e01ae8152194d4f235c8 100644
+index 4c84fb3648b3de36015b325246559f8aefe2ebd5..a81f40507b2233c3bde03b940cccd6be0aaa4926 100644
 --- a/content/public/browser/content_browser_client.h
 +++ b/content/public/browser/content_browser_client.h
-@@ -210,8 +210,37 @@ CONTENT_EXPORT void OverrideOnBindInterface(
+@@ -211,8 +211,37 @@ CONTENT_EXPORT void OverrideOnBindInterface(
  // the observer interfaces.)
  class CONTENT_EXPORT ContentBrowserClient {
   public:

+ 18 - 18
patches/common/chromium/mas_no_private_api.patch

@@ -38,7 +38,7 @@ index 743d1364bcd13e24ecbe5ced730161d15b8c3e93..a7e81072194c00baa0aa3159a6bfe374
  // is concerned.
  @property(nonatomic, readonly) NSString* subrole;
 diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm
-index 8caf327f3fbc65d7f44c329ed9a5177591e4cdba..e628cef11674737b14f4e10d76a48935359b4dea 100644
+index 237b07caa5ed7626c3b5b538cbb77f582f884203..cc4cb1ce9308ba8aecd6cc138954a1b5e04e6d29 100644
 --- a/content/browser/accessibility/browser_accessibility_cocoa.mm
 +++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
 @@ -141,6 +141,7 @@
@@ -85,7 +85,7 @@ index 8caf327f3fbc65d7f44c329ed9a5177591e4cdba..e628cef11674737b14f4e10d76a48935
        {NSAccessibilitySizeAttribute, @"size"},
        {NSAccessibilitySortDirectionAttribute, @"sortDirection"},
        {NSAccessibilitySubroleAttribute, @"subrole"},
-@@ -1144,6 +1152,7 @@ - (NSNumber*)enabled {
+@@ -1145,6 +1153,7 @@ - (NSNumber*)enabled {
                                    ax::mojom::Restriction::kDisabled];
  }
  
@@ -93,7 +93,7 @@ index 8caf327f3fbc65d7f44c329ed9a5177591e4cdba..e628cef11674737b14f4e10d76a48935
  // Returns a text marker that points to the last character in the document that
  // can be selected with VoiceOver.
  - (id)endTextMarker {
-@@ -1154,6 +1163,7 @@ - (id)endTextMarker {
+@@ -1155,6 +1164,7 @@ - (id)endTextMarker {
    BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0);
    return CreateTextMarker(position->CreatePositionAtEndOfAnchor());
  }
@@ -101,7 +101,7 @@ index 8caf327f3fbc65d7f44c329ed9a5177591e4cdba..e628cef11674737b14f4e10d76a48935
  
  - (NSNumber*)expanded {
    if (![self instanceActive])
-@@ -2029,6 +2039,7 @@ - (NSValue*)selectedTextRange {
+@@ -2033,6 +2043,7 @@ - (NSValue*)selectedTextRange {
    return [NSValue valueWithRange:NSMakeRange(selStart, selLength)];
  }
  
@@ -109,7 +109,7 @@ index 8caf327f3fbc65d7f44c329ed9a5177591e4cdba..e628cef11674737b14f4e10d76a48935
  - (id)selectedTextMarkerRange {
    if (![self instanceActive])
      return nil;
-@@ -2061,6 +2072,7 @@ - (id)selectedTextMarkerRange {
+@@ -2065,6 +2076,7 @@ - (id)selectedTextMarkerRange {
                                                 anchorAffinity, *focusObject,
                                                 focusOffset, focusAffinity));
  }
@@ -117,7 +117,7 @@ index 8caf327f3fbc65d7f44c329ed9a5177591e4cdba..e628cef11674737b14f4e10d76a48935
  
  - (NSValue*)size {
    if (![self instanceActive])
-@@ -2093,6 +2105,7 @@ - (NSString*)sortDirection {
+@@ -2097,6 +2109,7 @@ - (NSString*)sortDirection {
    return nil;
  }
  
@@ -125,7 +125,7 @@ index 8caf327f3fbc65d7f44c329ed9a5177591e4cdba..e628cef11674737b14f4e10d76a48935
  // Returns a text marker that points to the first character in the document that
  // can be selected with VoiceOver.
  - (id)startTextMarker {
-@@ -2103,6 +2116,7 @@ - (id)startTextMarker {
+@@ -2107,6 +2120,7 @@ - (id)startTextMarker {
    BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0);
    return CreateTextMarker(position->CreatePositionAtStartOfAnchor());
  }
@@ -133,7 +133,7 @@ index 8caf327f3fbc65d7f44c329ed9a5177591e4cdba..e628cef11674737b14f4e10d76a48935
  
  // Returns a subrole based upon the role.
  - (NSString*)subrole {
-@@ -2403,12 +2417,14 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range {
+@@ -2407,12 +2421,14 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range {
    NSMutableAttributedString* attributedValue =
        [[[NSMutableAttributedString alloc] initWithString:value] autorelease];
  
@@ -148,7 +148,7 @@ index 8caf327f3fbc65d7f44c329ed9a5177591e4cdba..e628cef11674737b14f4e10d76a48935
  
    return [attributedValue attributedSubstringFromRange:range];
  }
-@@ -2491,6 +2507,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
+@@ -2495,6 +2511,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
        return ToBrowserAccessibilityCocoa(cell);
    }
  
@@ -156,7 +156,7 @@ index 8caf327f3fbc65d7f44c329ed9a5177591e4cdba..e628cef11674737b14f4e10d76a48935
    if ([attribute isEqualToString:@"AXUIElementForTextMarker"]) {
      BrowserAccessibilityPositionInstance position =
          CreatePositionFromTextMarker(parameter);
-@@ -2668,6 +2685,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
+@@ -2672,6 +2689,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
      NSString* text = GetTextForTextMarkerRange(parameter);
      return [NSNumber numberWithInt:[text length]];
    }
@@ -164,7 +164,7 @@ index 8caf327f3fbc65d7f44c329ed9a5177591e4cdba..e628cef11674737b14f4e10d76a48935
  
    if ([attribute isEqualToString:
                       NSAccessibilityBoundsForRangeParameterizedAttribute]) {
-@@ -2701,6 +2719,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
+@@ -2705,6 +2723,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
      return nil;
    }
  
@@ -172,7 +172,7 @@ index 8caf327f3fbc65d7f44c329ed9a5177591e4cdba..e628cef11674737b14f4e10d76a48935
    if ([attribute
            isEqualToString:
                NSAccessibilityLineTextMarkerRangeForTextMarkerParameterizedAttribute]) {
-@@ -2781,6 +2800,7 @@ AXPlatformRange range(position->CreatePreviousLineStartPosition(
+@@ -2785,6 +2804,7 @@ AXPlatformRange range(position->CreatePreviousLineStartPosition(
  
      return @(child->GetIndexInParent());
    }
@@ -181,10 +181,10 @@ index 8caf327f3fbc65d7f44c329ed9a5177591e4cdba..e628cef11674737b14f4e10d76a48935
    return nil;
  }
 diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm b/content/browser/accessibility/browser_accessibility_manager_mac.mm
-index 8ccb8d266ef921b60c9db562f54431bb2bd8d327..1dbcdd5f7e742d993478190846b0052c0da252b5 100644
+index e02f5f922ea0eeca39fdf0acc265e1ef9dc254a6..764cac3182c3611e2c1fc4a0aa73b13ac81a9a72 100644
 --- a/content/browser/accessibility/browser_accessibility_manager_mac.mm
 +++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm
-@@ -489,6 +489,7 @@ void PostAnnouncementNotification(NSString* announcement) {
+@@ -491,6 +491,7 @@ void PostAnnouncementNotification(NSString* announcement) {
        [user_info setObject:native_focus_object
                      forKey:NSAccessibilityTextChangeElement];
  
@@ -192,7 +192,7 @@ index 8ccb8d266ef921b60c9db562f54431bb2bd8d327..1dbcdd5f7e742d993478190846b0052c
        id selected_text = [native_focus_object selectedTextMarkerRange];
        if (selected_text) {
          NSString* const NSAccessibilitySelectedTextMarkerRangeAttribute =
-@@ -496,6 +497,7 @@ void PostAnnouncementNotification(NSString* announcement) {
+@@ -498,6 +499,7 @@ void PostAnnouncementNotification(NSString* announcement) {
          [user_info setObject:selected_text
                        forKey:NSAccessibilitySelectedTextMarkerRangeAttribute];
        }
@@ -233,7 +233,7 @@ index e59ac93d0e1554a2df5d8c74db2beba25d090228..6657c48664bdec4964b382f80309d1bf
  
  }  // namespace
 diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm
-index 6151c7b0ce1325402668a17d35be72fd953fcd2d..1836a0fac0cc3561151067d3482a58dc20b07559 100644
+index fcf50dc3bd9a94536d7fc457c4e7b413a83dc672..6252cb195ff77aa31295c4958fd6b80c8a0df8bd 100644
 --- a/device/bluetooth/bluetooth_adapter_mac.mm
 +++ b/device/bluetooth/bluetooth_adapter_mac.mm
 @@ -36,6 +36,7 @@
@@ -252,7 +252,7 @@ index 6151c7b0ce1325402668a17d35be72fd953fcd2d..1836a0fac0cc3561151067d3482a58dc
  
  namespace {
  
-@@ -122,8 +124,10 @@ CBCentralManagerState GetCBManagerState(CBCentralManager* manager) {
+@@ -121,8 +123,10 @@ CBCentralManagerState GetCBManagerState(CBCentralManager* manager) {
        controller_state_function_(
            base::BindRepeating(&BluetoothAdapterMac::GetHostControllerState,
                                base::Unretained(this))),
@@ -263,7 +263,7 @@ index 6151c7b0ce1325402668a17d35be72fd953fcd2d..1836a0fac0cc3561151067d3482a58dc
        should_update_name_(true),
        classic_discovery_manager_(
            BluetoothDiscoveryManagerMac::CreateClassic(this)),
-@@ -321,8 +325,12 @@ CBCentralManagerState GetCBManagerState(CBCentralManager* manager) {
+@@ -319,8 +323,12 @@ CBCentralManagerState GetCBManagerState(CBCentralManager* manager) {
  }
  
  bool BluetoothAdapterMac::SetPoweredImpl(bool powered) {

+ 2 - 2
patches/common/chromium/notification_provenance.patch

@@ -109,10 +109,10 @@ index 3373171efb690863c70cd10bd465fc4b3dd5320c..64f2c0344eb9978e712f5c39e1f43d9b
  
    // Removes |service| from the list of owned services, for example because the
 diff --git a/content/browser/renderer_interface_binders.cc b/content/browser/renderer_interface_binders.cc
-index a5d05bdb62acf57e979aa9742dfaa24c54bc02b1..058f23de5a963da40fefa0345645db7d5e2df493 100644
+index c3955dd7250f0e608dc21e7b553d9b00af43286d..081d717c0bdffe04146e8cb854d0f52bfe644015 100644
 --- a/content/browser/renderer_interface_binders.cc
 +++ b/content/browser/renderer_interface_binders.cc
-@@ -208,7 +208,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
+@@ -207,7 +207,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
                      RenderProcessHost* host, const url::Origin& origin) {
          static_cast<StoragePartitionImpl*>(host->GetStoragePartition())
              ->GetPlatformNotificationContext()

+ 11 - 11
patches/common/chromium/printing.patch

@@ -283,7 +283,7 @@ index 1802034a6e15a6ad8b0d9591cfb79ba5873dc982..a827091facdb4f6b1d74ce826c3492ce
  // Like PrintMsg_PrintPages, but using the print preview document's frame/node.
  IPC_MESSAGE_ROUTED0(PrintMsg_PrintForSystemDialog)
 diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
-index eb717d8d4be31b181d4646dafbfba87ed7fcfd91..ebcc563f040949e346a3daa85c766a9c1fe7aa0f 100644
+index 74f26daa76a22c749007f06a7f4eeeafb8bb297b..5c54aad4e874d723dd4b9e5733449d2af6d9e047 100644
 --- a/components/printing/renderer/print_render_frame_helper.cc
 +++ b/components/printing/renderer/print_render_frame_helper.cc
 @@ -1115,7 +1115,9 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
@@ -337,7 +337,7 @@ index eb717d8d4be31b181d4646dafbfba87ed7fcfd91..ebcc563f040949e346a3daa85c766a9c
    print_preview_context_.OnPrintPreview();
  
    UMA_HISTOGRAM_ENUMERATION("PrintPreview.PreviewEvent",
-@@ -1622,7 +1630,10 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
+@@ -1621,7 +1629,10 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
  
      auto self = weak_ptr_factory_.GetWeakPtr();
      Print(duplicate_node.GetDocument().GetFrame(), duplicate_node,
@@ -349,7 +349,7 @@ index eb717d8d4be31b181d4646dafbfba87ed7fcfd91..ebcc563f040949e346a3daa85c766a9c
      // Check if |this| is still valid.
      if (!self)
        return;
-@@ -1633,7 +1644,10 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
+@@ -1632,7 +1643,10 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
  
  void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
                                     const blink::WebNode& node,
@@ -361,7 +361,7 @@ index eb717d8d4be31b181d4646dafbfba87ed7fcfd91..ebcc563f040949e346a3daa85c766a9c
    // If still not finished with earlier print request simply ignore.
    if (prep_frame_view_)
      return;
-@@ -1641,7 +1655,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
+@@ -1640,7 +1654,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
    FrameReference frame_ref(frame);
  
    int expected_page_count = 0;
@@ -370,7 +370,7 @@ index eb717d8d4be31b181d4646dafbfba87ed7fcfd91..ebcc563f040949e346a3daa85c766a9c
      DidFinishPrinting(FAIL_PRINT_INIT);
      return;  // Failed to init print page settings.
    }
-@@ -1661,8 +1675,9 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
+@@ -1660,8 +1674,9 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
  
      PrintMsg_PrintPages_Params print_settings;
      auto self = weak_ptr_factory_.GetWeakPtr();
@@ -382,7 +382,7 @@ index eb717d8d4be31b181d4646dafbfba87ed7fcfd91..ebcc563f040949e346a3daa85c766a9c
      // Check if |this| is still valid.
      if (!self)
        return;
-@@ -1672,6 +1687,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
+@@ -1671,6 +1686,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
              ? blink::kWebPrintScalingOptionSourceSize
              : scaling_option;
      SetPrintPagesParams(print_settings);
@@ -390,7 +390,7 @@ index eb717d8d4be31b181d4646dafbfba87ed7fcfd91..ebcc563f040949e346a3daa85c766a9c
      if (print_settings.params.dpi.IsEmpty() ||
          !print_settings.params.document_cookie) {
        DidFinishPrinting(OK);  // Release resources and fail silently on failure.
-@@ -1860,10 +1876,24 @@ std::vector<int> PrintRenderFrameHelper::GetPrintedPages(
+@@ -1859,10 +1875,24 @@ std::vector<int> PrintRenderFrameHelper::GetPrintedPages(
    return printed_pages;
  }
  
@@ -418,7 +418,7 @@ index eb717d8d4be31b181d4646dafbfba87ed7fcfd91..ebcc563f040949e346a3daa85c766a9c
    // Check if the printer returned any settings, if the settings is empty, we
    // can safely assume there are no printer drivers configured. So we safely
    // terminate.
-@@ -1883,12 +1913,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
+@@ -1882,12 +1912,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
    return result;
  }
  
@@ -438,7 +438,7 @@ index eb717d8d4be31b181d4646dafbfba87ed7fcfd91..ebcc563f040949e346a3daa85c766a9c
      Send(new PrintHostMsg_ShowInvalidPrinterSettingsError(routing_id()));
      return false;
 diff --git a/components/printing/renderer/print_render_frame_helper.h b/components/printing/renderer/print_render_frame_helper.h
-index c4effb05d16cd67acf3d8140d25eb33fb4814dc3..0660062708438a2de7132b1a39dcbac85f8b8cbf 100644
+index 1e2777561ba600f8c11a59c79e3e1f6a4e4e696e..b4df0b89bce2ea7bf3a6ad2f02fb3821417cbb87 100644
 --- a/components/printing/renderer/print_render_frame_helper.h
 +++ b/components/printing/renderer/print_render_frame_helper.h
 @@ -193,7 +193,9 @@ class PrintRenderFrameHelper
@@ -452,7 +452,7 @@ index c4effb05d16cd67acf3d8140d25eb33fb4814dc3..0660062708438a2de7132b1a39dcbac8
    void OnPrintForSystemDialog();
  #if BUILDFLAG(ENABLE_PRINT_PREVIEW)
    void OnInitiatePrintPreview(bool has_selection);
-@@ -244,7 +246,10 @@ class PrintRenderFrameHelper
+@@ -243,7 +245,10 @@ class PrintRenderFrameHelper
    // WARNING: |this| may be gone after this method returns.
    void Print(blink::WebLocalFrame* frame,
               const blink::WebNode& node,
@@ -464,7 +464,7 @@ index c4effb05d16cd67acf3d8140d25eb33fb4814dc3..0660062708438a2de7132b1a39dcbac8
  
    // Notification when printing is done - signal tear-down/free resources.
    void DidFinishPrinting(PrintingResult result);
-@@ -253,12 +258,14 @@ class PrintRenderFrameHelper
+@@ -252,12 +257,14 @@ class PrintRenderFrameHelper
  
    // Initialize print page settings with default settings.
    // Used only for native printing workflow.

+ 1 - 1
patches/common/chromium/render_widget_host_view_mac.patch

@@ -66,7 +66,7 @@ index 8284524948c54c91e80e61c046ef7a8a7e66ba66..5e0218a0933df9440bcb86ac89373c41
    return validAttributesForMarkedText_.get();
  }
 diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
-index c6f096b1f58265b6dfe469d271e3decb96c14f14..819803a665e145565e2b71541835750983ebf8a5 100644
+index 605fe2face44403b470fb372fadb22c38b6d1068..e25d4e7abc435cf16522aa66a423f5c0b64eddb9 100644
 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm
 +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
 @@ -62,6 +62,7 @@

+ 3 - 3
patches/common/chromium/resource_file_conflict.patch

@@ -52,10 +52,10 @@ Some alternatives to this patch:
 None of these options seems like a substantial maintainability win over this patch to me (@nornagon).
 
 diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
-index a1be2930c8dd785b1805260a82b37f8acfa80a5d..b7532fd8e220ecf1039bfa00412f9e930f7d1b02 100644
+index 2503eb797188cbb22be0ad703a35d30c16dfad9f..f0c614e9e174a2fa362242559026c8c30dee56bf 100644
 --- a/chrome/BUILD.gn
 +++ b/chrome/BUILD.gn
-@@ -1789,7 +1789,7 @@ if (is_chrome_branded && !is_android) {
+@@ -1685,7 +1685,7 @@ if (is_chrome_branded && !is_android) {
    }
  }
  
@@ -64,7 +64,7 @@ index a1be2930c8dd785b1805260a82b37f8acfa80a5d..b7532fd8e220ecf1039bfa00412f9e93
    chrome_paks("packed_resources") {
      if (is_mac) {
        output_dir = "$root_gen_dir/repack"
-@@ -1813,6 +1813,12 @@ if (!is_android) {
+@@ -1709,6 +1709,12 @@ if (!is_android) {
    }
  }
  

+ 2 - 2
patches/common/chromium/scroll_bounce_flag.patch

@@ -6,10 +6,10 @@ Subject: scroll_bounce_flag.patch
 Patch to make scrollBounce option work.
 
 diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
-index ee84cf4e2791ccbe76f3527158c633e2b56e71c7..72033c83d8bb39dfbb748f22796f9ff69ef1e329 100644
+index 036f9c735e5409fe69c992a97eb57d7d224e6e81..97a9928d0c9ecd8c18f925e5d660e3de39745386 100644
 --- a/content/renderer/render_thread_impl.cc
 +++ b/content/renderer/render_thread_impl.cc
-@@ -1513,7 +1513,7 @@ bool RenderThreadImpl::IsGpuMemoryBufferCompositorResourcesEnabled() {
+@@ -1520,7 +1520,7 @@ bool RenderThreadImpl::IsGpuMemoryBufferCompositorResourcesEnabled() {
  }
  
  bool RenderThreadImpl::IsElasticOverscrollEnabled() {

+ 5 - 5
patches/common/chromium/support_mixed_sandbox_with_zygote.patch

@@ -22,10 +22,10 @@ However, the patch would need to be reviewed by the security team, as it
 does touch a security-sensitive class.
 
 diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
-index 763bec5cedfc44e59ccd40dcbcf7b3f9544cd56e..982b82ef2b517bd21f05f24efc8e0d78c111d495 100644
+index a1ed7949ba0623af8989b7286c11bca797278227..f58456df8d856346a2350b87ecd84de5b75e0d13 100644
 --- a/content/browser/renderer_host/render_process_host_impl.cc
 +++ b/content/browser/renderer_host/render_process_host_impl.cc
-@@ -418,6 +418,10 @@ class RendererSandboxedProcessLauncherDelegate
+@@ -417,6 +417,10 @@ class RendererSandboxedProcessLauncherDelegate
      : public SandboxedProcessLauncherDelegate {
   public:
    RendererSandboxedProcessLauncherDelegate() {}
@@ -36,7 +36,7 @@ index 763bec5cedfc44e59ccd40dcbcf7b3f9544cd56e..982b82ef2b517bd21f05f24efc8e0d78
  
    ~RendererSandboxedProcessLauncherDelegate() override {}
  
-@@ -437,6 +441,9 @@ class RendererSandboxedProcessLauncherDelegate
+@@ -436,6 +440,9 @@ class RendererSandboxedProcessLauncherDelegate
  
  #if BUILDFLAG(USE_ZYGOTE_HANDLE)
    service_manager::ZygoteHandle GetZygote() override {
@@ -46,7 +46,7 @@ index 763bec5cedfc44e59ccd40dcbcf7b3f9544cd56e..982b82ef2b517bd21f05f24efc8e0d78
      const base::CommandLine& browser_command_line =
          *base::CommandLine::ForCurrentProcess();
      base::CommandLine::StringType renderer_prefix =
-@@ -450,6 +457,11 @@ class RendererSandboxedProcessLauncherDelegate
+@@ -449,6 +456,11 @@ class RendererSandboxedProcessLauncherDelegate
    service_manager::SandboxType GetSandboxType() override {
      return service_manager::SANDBOX_TYPE_RENDERER;
    }
@@ -58,7 +58,7 @@ index 763bec5cedfc44e59ccd40dcbcf7b3f9544cd56e..982b82ef2b517bd21f05f24efc8e0d78
  };
  
  const char kSessionStorageHolderKey[] = "kSessionStorageHolderKey";
-@@ -1730,11 +1742,18 @@ bool RenderProcessHostImpl::Init() {
+@@ -1729,11 +1741,18 @@ bool RenderProcessHostImpl::Init() {
        cmd_line->PrependWrapper(renderer_prefix);
      AppendRendererCommandLine(cmd_line.get());
  

+ 4 - 4
patches/common/chromium/viz_osr.patch

@@ -512,13 +512,13 @@ index 360cab3eee4c5189a55269d76daa1d78a98ed3d3..6834242f23d27fd6d428c2cd6040206a
 +  Draw(gfx.mojom.Rect damage_rect) => ();
  };
 diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
-index ce87db97e02af3c4ec358ae688e0f2a96492d952..cacda701a6da00a22a2eaaaaf4d3fad543ce1a04 100644
+index 494241c374b7ffac0fa89549dc1b8a30359eb17f..5ac7c707374ebcb5510c76017edfcceee97b599e 100644
 --- a/ui/compositor/compositor.h
 +++ b/ui/compositor/compositor.h
-@@ -24,6 +24,7 @@
+@@ -23,6 +23,7 @@
+ #include "cc/trees/layer_tree_host_single_thread_client.h"
  #include "components/viz/common/frame_sinks/begin_frame_args.h"
  #include "components/viz/common/surfaces/frame_sink_id.h"
- #include "components/viz/common/surfaces/local_surface_id_allocation.h"
 +#include "components/viz/host/host_display_client.h"
  #include "components/viz/host/host_frame_sink_client.h"
  #include "services/viz/privileged/interfaces/compositing/vsync_parameter_observer.mojom-forward.h"
@@ -549,7 +549,7 @@ index ce87db97e02af3c4ec358ae688e0f2a96492d952..cacda701a6da00a22a2eaaaaf4d3fad5
    // Sets the root of the layer tree drawn by this Compositor. The root layer
    // must have no parent. The compositor's root layer is reset if the root layer
    // is destroyed. NULL can be passed to reset the root layer, in which case the
-@@ -467,6 +480,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
+@@ -454,6 +467,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
    ui::ContextFactory* context_factory_;
    ui::ContextFactoryPrivate* context_factory_private_;
  

+ 3 - 3
patches/common/chromium/web_contents.patch

@@ -5,10 +5,10 @@ Subject: web_contents.patch
 
 
 diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
-index 5ddd9e7545d2139545fcf3e308d64a5a68a99735..27f69b81ba9ba2b96c7832ca7933ee496ec1b7e4 100644
+index 05f63c0802d4af296064e258e827098fbe97e972..0b3cee64c9a13ed6cc0f187571eb90db12fcb66a 100644
 --- a/content/browser/web_contents/web_contents_impl.cc
 +++ b/content/browser/web_contents/web_contents_impl.cc
-@@ -2067,6 +2067,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
+@@ -2068,6 +2068,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
    std::string unique_name;
    frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name);
  
@@ -21,7 +21,7 @@ index 5ddd9e7545d2139545fcf3e308d64a5a68a99735..27f69b81ba9ba2b96c7832ca7933ee49
    WebContentsViewDelegate* delegate =
        GetContentClient()->browser()->GetWebContentsViewDelegate(this);
  
-@@ -2082,6 +2088,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
+@@ -2083,6 +2089,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
            &render_view_host_delegate_view_);
      }
    }

+ 5 - 5
patches/common/chromium/worker_context_will_destroy.patch

@@ -5,7 +5,7 @@ Subject: worker_context_will_destroy.patch
 
 
 diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h
-index 5bcf6f95f630ae6232ec9be7d8de7360a1592566..3142a8286e6aaf508a06cee0e32c73903682261f 100644
+index fa2e153443329bcb5a48fe5c577db74a1aec26ca..6bad6c2e34e73d990d49fca4ad953cfbf8deba83 100644
 --- a/content/public/renderer/content_renderer_client.h
 +++ b/content/public/renderer/content_renderer_client.h
 @@ -384,6 +384,11 @@ class CONTENT_EXPORT ContentRendererClient {
@@ -21,7 +21,7 @@ index 5bcf6f95f630ae6232ec9be7d8de7360a1592566..3142a8286e6aaf508a06cee0e32c7390
    // An empty URL is returned if the URL is not overriden.
    virtual GURL OverrideFlashEmbedWithHTML(const GURL& url);
 diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc
-index 2c8ade035da690db45fc629ef2aeebf701b20c59..3a23749a6b4a938320edcdc01857c5c741c66b6a 100644
+index 922aae383d1eb768c94068674fe57864717baf35..2772afc477188a5c465bb7cdb4c97a28da560700 100644
 --- a/content/renderer/renderer_blink_platform_impl.cc
 +++ b/content/renderer/renderer_blink_platform_impl.cc
 @@ -1051,6 +1051,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() {
@@ -50,7 +50,7 @@ index 39d9cf7590c11a178acbf8f9c6dbc3d20088860c..bef9d6351c2a9456ffc5279343515c01
    void RecordMetricsForBackgroundedRendererPurge() override;
  
 diff --git a/third_party/blink/public/platform/platform.h b/third_party/blink/public/platform/platform.h
-index f2a375b8fc9fd8ef808898ace40139f533c5dae4..083e94481c4c9f8a485984c849e5d2960a4cf6b5 100644
+index 782a3a3a121620a130ff165e0f0bccba0fe0c61a..cdbabdbd09065e843bf6fe75055b7fc32a310065 100644
 --- a/third_party/blink/public/platform/platform.h
 +++ b/third_party/blink/public/platform/platform.h
 @@ -656,6 +656,7 @@ class BLINK_PLATFORM_EXPORT Platform {
@@ -62,10 +62,10 @@ index f2a375b8fc9fd8ef808898ace40139f533c5dae4..083e94481c4c9f8a485984c849e5d296
        const WebSecurityOrigin& script_origin) {
      return false;
 diff --git a/third_party/blink/renderer/core/workers/worker_thread.cc b/third_party/blink/renderer/core/workers/worker_thread.cc
-index 0da8aa29d7ddf6564d46fd1b439f040bc9491527..4c9163415298c2e766e0d64f8a2b0d9110a9032c 100644
+index 512c3335456016c6d9afebe607999cff3e9f4709..7c90cb0cd86f528895f6ffebfcde854acb7cd124 100644
 --- a/third_party/blink/renderer/core/workers/worker_thread.cc
 +++ b/third_party/blink/renderer/core/workers/worker_thread.cc
-@@ -634,6 +634,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() {
+@@ -637,6 +637,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() {
      nested_runner_->QuitNow();
    }
  

+ 0 - 4
patches/common/v8/.patches

@@ -1,11 +1,7 @@
 add_realloc.patch
 build_gn.patch
 expose_mksnapshot.patch
-revert_api_remove_deprecated_conversion_functions.patch
 deps_provide_more_v8_backwards_compatibility.patch
 dcheck.patch
-revert_reland_api_heap_remove_deprecated_persistent_apis.patch
-fixme_revert_heap_api_remove_deprecated_apis.patch
-revert_cctest_add_v8_export_private_to_arm_arm64_ports.patch
 export_symbols_needed_for_windows_build.patch
 workaround_an_undefined_symbol_error.patch

+ 2 - 2
patches/common/v8/add_realloc.patch

@@ -12,7 +12,7 @@ when we override ReallocateBufferMemory, so we therefore need to implement
 Realloc on the v8 side.
 
 diff --git a/include/v8.h b/include/v8.h
-index 29c32d5ab77db52e4e02f140ac38ef46ff7bfc41..0b517b7a469451952723e10ad834d94c2f17e3e3 100644
+index c54b088404229dccf015e20b6a5bab19d3d94e69..cc603dc4aae69de4b09f06ed0bca48cdae8eebd3 100644
 --- a/include/v8.h
 +++ b/include/v8.h
 @@ -4624,6 +4624,13 @@ class V8_EXPORT ArrayBuffer : public Object {
@@ -30,7 +30,7 @@ index 29c32d5ab77db52e4e02f140ac38ef46ff7bfc41..0b517b7a469451952723e10ad834d94c
       * Free the memory block of size |length|, pointed to by |data|.
       * That memory is guaranteed to be previously allocated by |Allocate|.
 diff --git a/src/api/api.cc b/src/api/api.cc
-index b94accdd253770fda80ec81372ba241cd33bc7ca..5202fc9f77559d2e25c71f8f81de3cccbb7ba891 100644
+index e6d23c4306eaae0aca293a200d998c2f68f7db17..dc1efc9015ab058eb38812eba7cd92e050a709b0 100644
 --- a/src/api/api.cc
 +++ b/src/api/api.cc
 @@ -515,6 +515,10 @@ void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) {

+ 3 - 3
patches/common/v8/build_gn.patch

@@ -5,7 +5,7 @@ Subject: build_gn.patch
 
 
 diff --git a/BUILD.gn b/BUILD.gn
-index e8604cc8765457c2f3e74d0531a6917af35b6d81..098e6bc57d2607b88372eb67495aa7f6d4d0a693 100644
+index 029a66a4358a3bc13963e089105a3dc46e341228..98df02e301361b2a4b01b19aa44e53e6e721bed7 100644
 --- a/BUILD.gn
 +++ b/BUILD.gn
 @@ -273,7 +273,7 @@ config("internal_config") {
@@ -17,7 +17,7 @@ index e8604cc8765457c2f3e74d0531a6917af35b6d81..098e6bc57d2607b88372eb67495aa7f6
      defines += [ "BUILDING_V8_SHARED" ]
    }
  }
-@@ -3776,7 +3776,7 @@ if (current_toolchain == v8_generator_toolchain) {
+@@ -3780,7 +3780,7 @@ if (current_toolchain == v8_generator_toolchain) {
        "src/interpreter/bytecodes.h",
      ]
  
@@ -26,7 +26,7 @@ index e8604cc8765457c2f3e74d0531a6917af35b6d81..098e6bc57d2607b88372eb67495aa7f6
  
      deps = [
        ":v8_libbase",
-@@ -3801,6 +3801,8 @@ if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) {
+@@ -3811,6 +3811,8 @@ if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) {
  
      configs = [ ":internal_config" ]
  

+ 4 - 4
patches/common/v8/dcheck.patch

@@ -5,10 +5,10 @@ Subject: dcheck.patch
 
 
 diff --git a/src/api/api.cc b/src/api/api.cc
-index f12b8ee0b3883f384a9500dca4ff25b1e6e3e2ec..efaa78cd42945c0a9176a53d59364f488648418a 100644
+index 659a45618a69bf742730d3456e3d4860efa9994f..103f2f479262bea69358544c59a784915d070e06 100644
 --- a/src/api/api.cc
 +++ b/src/api/api.cc
-@@ -8289,7 +8289,7 @@ void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) {
+@@ -8238,7 +8238,7 @@ void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) {
  }
  
  void Isolate::RunMicrotasks() {
@@ -18,10 +18,10 @@ index f12b8ee0b3883f384a9500dca4ff25b1e6e3e2ec..efaa78cd42945c0a9176a53d59364f48
    isolate->default_microtask_queue()->RunMicrotasks(isolate);
  }
 diff --git a/src/heap/heap.cc b/src/heap/heap.cc
-index b32c4a004a0d2b91d5bd9e38d2e127248f877004..83294dbaaabbc5aebf39bc74eddb19d9b114feef 100644
+index c4c52bab7c3a5dac285a3349fce12b74400e7290..afc6418f6aed1f017b6fbf8f93ed487b61bda5c7 100644
 --- a/src/heap/heap.cc
 +++ b/src/heap/heap.cc
-@@ -5075,9 +5075,9 @@ void Heap::TearDown() {
+@@ -5085,9 +5085,9 @@ void Heap::TearDown() {
  void Heap::AddGCPrologueCallback(v8::Isolate::GCCallbackWithData callback,
                                   GCType gc_type, void* data) {
    DCHECK_NOT_NULL(callback);

+ 34 - 34
patches/common/v8/deps_provide_more_v8_backwards_compatibility.patch

@@ -22,7 +22,7 @@ Reviewed-By: Yang Guo <[email protected]>
 Reviewed-By: Michaël Zasso <[email protected]>
 
 diff --git a/include/v8.h b/include/v8.h
-index 8012a1935018dde4ec72fd3945457321be9f6319..cb9da12b88bca393ea814a226da82ecae857d343 100644
+index cc603dc4aae69de4b09f06ed0bca48cdae8eebd3..c59b0fa69880c237e3b60f190160d8b94862bf36 100644
 --- a/include/v8.h
 +++ b/include/v8.h
 @@ -1108,6 +1108,10 @@ class V8_EXPORT PrimitiveArray {
@@ -45,9 +45,9 @@ index 8012a1935018dde4ec72fd3945457321be9f6319..cb9da12b88bca393ea814a226da82eca
    Local<StackFrame> GetFrame(Isolate* isolate, uint32_t index) const;
  
    /**
-@@ -2522,6 +2528,13 @@ class V8_EXPORT Value : public Data {
-   V8_DEPRECATED("Use maybe version",
-                 Local<Int32> ToInt32(Isolate* isolate) const);
+@@ -2509,6 +2515,13 @@ class V8_EXPORT Value : public Data {
+ 
+   Local<Boolean> ToBoolean(Isolate* isolate) const;
  
 +  inline V8_DEPRECATED("Use maybe version",
 +                       Local<Boolean> ToBoolean() const);
@@ -59,7 +59,7 @@ index 8012a1935018dde4ec72fd3945457321be9f6319..cb9da12b88bca393ea814a226da82eca
    /**
     * Attempts to convert a string to an array index.
     * Returns an empty handle if the conversion fails.
-@@ -2541,7 +2554,14 @@ class V8_EXPORT Value : public Data {
+@@ -2525,7 +2538,14 @@ class V8_EXPORT Value : public Data {
        Local<Context> context) const;
    V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
  
@@ -74,7 +74,7 @@ index 8012a1935018dde4ec72fd3945457321be9f6319..cb9da12b88bca393ea814a226da82eca
    V8_WARN_UNUSED_RESULT Maybe<bool> Equals(Local<Context> context,
                                             Local<Value> that) const;
    bool StrictEquals(Local<Value> that) const;
-@@ -2648,6 +2668,8 @@ class V8_EXPORT String : public Name {
+@@ -2632,6 +2652,8 @@ class V8_EXPORT String : public Name {
     * Returns the number of bytes in the UTF-8 encoded
     * representation of this string.
     */
@@ -83,7 +83,7 @@ index 8012a1935018dde4ec72fd3945457321be9f6319..cb9da12b88bca393ea814a226da82eca
    int Utf8Length(Isolate* isolate) const;
  
    /**
-@@ -2704,12 +2726,23 @@ class V8_EXPORT String : public Name {
+@@ -2688,12 +2710,23 @@ class V8_EXPORT String : public Name {
    // 16-bit character codes.
    int Write(Isolate* isolate, uint16_t* buffer, int start = 0, int length = -1,
              int options = NO_OPTIONS) const;
@@ -107,7 +107,7 @@ index 8012a1935018dde4ec72fd3945457321be9f6319..cb9da12b88bca393ea814a226da82eca
  
    /**
     * A zero length string.
-@@ -2877,6 +2910,9 @@ class V8_EXPORT String : public Name {
+@@ -2861,6 +2894,9 @@ class V8_EXPORT String : public Name {
     */
    static Local<String> Concat(Isolate* isolate, Local<String> left,
                                Local<String> right);
@@ -117,7 +117,7 @@ index 8012a1935018dde4ec72fd3945457321be9f6319..cb9da12b88bca393ea814a226da82eca
  
    /**
     * Creates a new external string using the data defined in the given
-@@ -2941,6 +2977,8 @@ class V8_EXPORT String : public Name {
+@@ -2925,6 +2961,8 @@ class V8_EXPORT String : public Name {
     */
    class V8_EXPORT Utf8Value {
     public:
@@ -126,7 +126,7 @@ index 8012a1935018dde4ec72fd3945457321be9f6319..cb9da12b88bca393ea814a226da82eca
      Utf8Value(Isolate* isolate, Local<v8::Value> obj);
      ~Utf8Value();
      char* operator*() { return str_; }
-@@ -2964,6 +3002,7 @@ class V8_EXPORT String : public Name {
+@@ -2948,6 +2986,7 @@ class V8_EXPORT String : public Name {
     */
    class V8_EXPORT Value {
     public:
@@ -134,7 +134,7 @@ index 8012a1935018dde4ec72fd3945457321be9f6319..cb9da12b88bca393ea814a226da82eca
      Value(Isolate* isolate, Local<v8::Value> obj);
      ~Value();
      uint16_t* operator*() { return str_; }
-@@ -5297,6 +5336,8 @@ class V8_EXPORT BooleanObject : public Object {
+@@ -5281,6 +5320,8 @@ class V8_EXPORT BooleanObject : public Object {
  class V8_EXPORT StringObject : public Object {
   public:
    static Local<Value> New(Isolate* isolate, Local<String> value);
@@ -143,13 +143,12 @@ index 8012a1935018dde4ec72fd3945457321be9f6319..cb9da12b88bca393ea814a226da82eca
  
    Local<String> ValueOf() const;
  
-@@ -10415,6 +10456,30 @@ template <class T> Value* Value::Cast(T* value) {
+@@ -10384,6 +10425,29 @@ template <class T> Value* Value::Cast(T* value) {
  }
  
  
 +Local<Boolean> Value::ToBoolean() const {
-+  return ToBoolean(Isolate::GetCurrent()->GetCurrentContext())
-+      .FromMaybe(Local<Boolean>());
++  return ToBoolean(Isolate::GetCurrent());
 +}
 +
 +
@@ -175,10 +174,10 @@ index 8012a1935018dde4ec72fd3945457321be9f6319..cb9da12b88bca393ea814a226da82eca
  #ifdef V8_ENABLE_CHECKS
    CheckCast(value);
 diff --git a/src/api/api.cc b/src/api/api.cc
-index 92bcc561d50276b31d5bd988dfa7247aaef20a8d..f12b8ee0b3883f384a9500dca4ff25b1e6e3e2ec 100644
+index dc1efc9015ab058eb38812eba7cd92e050a709b0..659a45618a69bf742730d3456e3d4860efa9994f 100644
 --- a/src/api/api.cc
 +++ b/src/api/api.cc
-@@ -2180,6 +2180,10 @@ int PrimitiveArray::Length() const {
+@@ -2171,6 +2171,10 @@ int PrimitiveArray::Length() const {
    return array->length();
  }
  
@@ -189,7 +188,7 @@ index 92bcc561d50276b31d5bd988dfa7247aaef20a8d..f12b8ee0b3883f384a9500dca4ff25b1
  void PrimitiveArray::Set(Isolate* v8_isolate, int index,
                           Local<Primitive> item) {
    i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
-@@ -2193,6 +2197,10 @@ void PrimitiveArray::Set(Isolate* v8_isolate, int index,
+@@ -2184,6 +2188,10 @@ void PrimitiveArray::Set(Isolate* v8_isolate, int index,
    array->set(index, *i_item);
  }
  
@@ -200,7 +199,7 @@ index 92bcc561d50276b31d5bd988dfa7247aaef20a8d..f12b8ee0b3883f384a9500dca4ff25b1
  Local<Primitive> PrimitiveArray::Get(Isolate* v8_isolate, int index) {
    i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
    i::Handle<i::FixedArray> array = Utils::OpenHandle(this);
-@@ -2876,6 +2884,10 @@ void Message::PrintCurrentStackTrace(Isolate* isolate, FILE* out) {
+@@ -2867,6 +2875,10 @@ void Message::PrintCurrentStackTrace(Isolate* isolate, FILE* out) {
  
  // --- S t a c k T r a c e ---
  
@@ -211,13 +210,12 @@ index 92bcc561d50276b31d5bd988dfa7247aaef20a8d..f12b8ee0b3883f384a9500dca4ff25b1
  Local<StackFrame> StackTrace::GetFrame(Isolate* v8_isolate,
                                         uint32_t index) const {
    i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
-@@ -3767,6 +3779,34 @@ void v8::RegExp::CheckCast(v8::Value* that) {
-                   "Could not convert to regular expression");
+@@ -3453,6 +3465,34 @@ MaybeLocal<BigInt> Value::ToBigInt(Local<Context> context) const {
+   RETURN_ESCAPED(result);
  }
  
 +bool Value::BooleanValue() const {
-+  return BooleanValue(Isolate::GetCurrent()->GetCurrentContext())
-+      .FromJust();
++  return BooleanValue(Isolate::GetCurrent());
 +}
 +
 +
@@ -243,10 +241,11 @@ index 92bcc561d50276b31d5bd988dfa7247aaef20a8d..f12b8ee0b3883f384a9500dca4ff25b1
 +  return Int32Value(Isolate::GetCurrent()->GetCurrentContext())
 +      .FromMaybe(0);
 +}
- 
- Maybe<bool> Value::BooleanValue(Local<Context> context) const {
-   i::Isolate* isolate = reinterpret_cast<i::Isolate*>(context->GetIsolate());
-@@ -3851,6 +3891,11 @@ MaybeLocal<Uint32> Value::ToArrayIndex(Local<Context> context) const {
++
+ bool Value::BooleanValue(Isolate* v8_isolate) const {
+   return Utils::OpenHandle(this)->BooleanValue(
+       reinterpret_cast<i::Isolate*>(v8_isolate));
+@@ -3801,6 +3841,11 @@ MaybeLocal<Uint32> Value::ToArrayIndex(Local<Context> context) const {
    return Local<Uint32>();
  }
  
@@ -258,7 +257,7 @@ index 92bcc561d50276b31d5bd988dfa7247aaef20a8d..f12b8ee0b3883f384a9500dca4ff25b1
  Maybe<bool> Value::Equals(Local<Context> context, Local<Value> that) const {
    i::Isolate* isolate = Utils::OpenHandle(*context)->GetIsolate();
    auto self = Utils::OpenHandle(this);
-@@ -5083,6 +5128,10 @@ bool String::ContainsOnlyOneByte() const {
+@@ -5033,6 +5078,10 @@ bool String::ContainsOnlyOneByte() const {
    return helper.Check(*str);
  }
  
@@ -269,7 +268,7 @@ index 92bcc561d50276b31d5bd988dfa7247aaef20a8d..f12b8ee0b3883f384a9500dca4ff25b1
  int String::Utf8Length(Isolate* isolate) const {
    i::Handle<i::String> str = Utils::OpenHandle(this);
    str = i::String::Flatten(reinterpret_cast<i::Isolate*>(isolate), str);
-@@ -5235,6 +5284,14 @@ static int WriteUtf8Impl(i::Vector<const Char> string, char* write_start,
+@@ -5185,6 +5234,14 @@ static int WriteUtf8Impl(i::Vector<const Char> string, char* write_start,
  }
  }  // anonymous namespace
  
@@ -284,7 +283,7 @@ index 92bcc561d50276b31d5bd988dfa7247aaef20a8d..f12b8ee0b3883f384a9500dca4ff25b1
  int String::WriteUtf8(Isolate* v8_isolate, char* buffer, int capacity,
                        int* nchars_ref, int options) const {
    i::Handle<i::String> str = Utils::OpenHandle(this);
-@@ -5273,6 +5330,16 @@ static inline int WriteHelper(i::Isolate* isolate, const String* string,
+@@ -5223,6 +5280,17 @@ static inline int WriteHelper(i::Isolate* isolate, const String* string,
    return end - start;
  }
  
@@ -293,6 +292,7 @@ index 92bcc561d50276b31d5bd988dfa7247aaef20a8d..f12b8ee0b3883f384a9500dca4ff25b1
 +  return WriteOneByte(Isolate::GetCurrent(), buffer, start, length, options);
 +}
 +
++
 +int String::Write(uint16_t* buffer, int start, int length,
 +                  int options) const {
 +  return Write(Isolate::GetCurrent(), buffer, start, length, options);
@@ -301,7 +301,7 @@ index 92bcc561d50276b31d5bd988dfa7247aaef20a8d..f12b8ee0b3883f384a9500dca4ff25b1
  int String::WriteOneByte(Isolate* isolate, uint8_t* buffer, int start,
                           int length, int options) const {
    return WriteHelper(reinterpret_cast<i::Isolate*>(isolate), this, buffer,
-@@ -6184,6 +6251,11 @@ MaybeLocal<String> String::NewFromTwoByte(Isolate* isolate,
+@@ -6132,6 +6200,11 @@ MaybeLocal<String> String::NewFromTwoByte(Isolate* isolate,
    return result;
  }
  
@@ -313,8 +313,8 @@ index 92bcc561d50276b31d5bd988dfa7247aaef20a8d..f12b8ee0b3883f384a9500dca4ff25b1
  Local<String> v8::String::Concat(Isolate* v8_isolate, Local<String> left,
                                   Local<String> right) {
    i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
-@@ -6453,6 +6525,10 @@ bool v8::BooleanObject::ValueOf() const {
-   return jsvalue->value()->IsTrue(isolate);
+@@ -6401,6 +6474,10 @@ bool v8::BooleanObject::ValueOf() const {
+   return jsvalue->value().IsTrue(isolate);
  }
  
 +Local<v8::Value> v8::StringObject::New(Local<String> value) {
@@ -324,7 +324,7 @@ index 92bcc561d50276b31d5bd988dfa7247aaef20a8d..f12b8ee0b3883f384a9500dca4ff25b1
  Local<v8::Value> v8::StringObject::New(Isolate* v8_isolate,
                                         Local<String> value) {
    i::Handle<i::String> string = Utils::OpenHandle(*value);
-@@ -8642,6 +8718,9 @@ bool MicrotasksScope::IsRunningMicrotasks(Isolate* v8_isolate) {
+@@ -8591,6 +8668,9 @@ bool MicrotasksScope::IsRunningMicrotasks(Isolate* v8_isolate) {
    return microtask_queue->IsRunningMicrotasks();
  }
  
@@ -334,7 +334,7 @@ index 92bcc561d50276b31d5bd988dfa7247aaef20a8d..f12b8ee0b3883f384a9500dca4ff25b1
  String::Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Local<v8::Value> obj)
      : str_(nullptr), length_(0) {
    if (obj.IsEmpty()) return;
-@@ -8659,6 +8738,9 @@ String::Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Local<v8::Value> obj)
+@@ -8608,6 +8688,9 @@ String::Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Local<v8::Value> obj)
  
  String::Utf8Value::~Utf8Value() { i::DeleteArray(str_); }
  

+ 6 - 6
patches/common/v8/export_symbols_needed_for_windows_build.patch

@@ -5,11 +5,11 @@ Subject: Export symbols needed for Windows build
 
 These symbols are required to build v8 with BUILD_V8_SHARED on Windows.
 
-diff --git a/src/objects.h b/src/objects.h
-index 16f5ff3d192016df9d3f8687a9978854fd916d64..5a2f0e02b2e4ab4c5ab8edd9d1dccfd7a2ad5e3a 100644
---- a/src/objects.h
-+++ b/src/objects.h
-@@ -803,7 +803,7 @@ enum class KeyCollectionMode {
+diff --git a/src/objects/objects.h b/src/objects/objects.h
+index 2a66cfff36a304ca19e20c83edd2bd9532bae549..d0e4ce49c972f4b873661610cc1d677bcc626f46 100644
+--- a/src/objects/objects.h
++++ b/src/objects/objects.h
+@@ -791,7 +791,7 @@ enum class KeyCollectionMode {
  // Utility superclass for stack-allocated objects that must be updated
  // on gc.  It provides two ways for the gc to update instances, either
  // iterating or updating after gc.
@@ -19,7 +19,7 @@ index 16f5ff3d192016df9d3f8687a9978854fd916d64..5a2f0e02b2e4ab4c5ab8edd9d1dccfd7
    explicit inline Relocatable(Isolate* isolate);
    inline virtual ~Relocatable();
 diff --git a/src/objects/ordered-hash-table.h b/src/objects/ordered-hash-table.h
-index 949c94f87708e64e39fb8de2131a5363d0d52b82..d20776b017fd57b9f9053b753a045c774e28496c 100644
+index 16db56818e5074e35cbb65b34219786c4cfe0d51..b14b8b44cedad707e99d175c9f63a1472ebe3c6e 100644
 --- a/src/objects/ordered-hash-table.h
 +++ b/src/objects/ordered-hash-table.h
 @@ -60,7 +60,7 @@ namespace internal {

+ 2 - 2
patches/common/v8/expose_mksnapshot.patch

@@ -6,10 +6,10 @@ Subject: expose_mksnapshot.patch
 Needed in order to target mksnapshot for mksnapshot zip.
 
 diff --git a/BUILD.gn b/BUILD.gn
-index 098e6bc57d2607b88372eb67495aa7f6d4d0a693..1d23860d7b01be1ec7f522d3a74ef214fe2df4b4 100644
+index 98df02e301361b2a4b01b19aa44e53e6e721bed7..e49d32517f4b48e6f7cc71d4994037190f9b9156 100644
 --- a/BUILD.gn
 +++ b/BUILD.gn
-@@ -3787,8 +3787,6 @@ if (current_toolchain == v8_generator_toolchain) {
+@@ -3791,8 +3791,6 @@ if (current_toolchain == v8_generator_toolchain) {
  
  if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) {
    v8_executable("mksnapshot") {

+ 0 - 261
patches/common/v8/fixme_revert_heap_api_remove_deprecated_apis.patch

@@ -1,261 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Samuel Attard <[email protected]>
-Date: Thu, 21 Mar 2019 22:29:55 -0700
-Subject: fixme: Revert "[heap,api] Remove deprecated APIs"
-
-This reverts commit f4b860d9b81956fb9d6815932522f4043fef56fa.
-
-This commit removes deprecated APIs that nan relies on, temporarily
-reverting but we need to solve this with nan upstream
-
-diff --git a/include/v8-internal.h b/include/v8-internal.h
-index fe2ce67e0df04e58502d73ca5ac81a86ee001494..ed110be42bf4d7ab47bee480d8dbbfe547fbc423 100644
---- a/include/v8-internal.h
-+++ b/include/v8-internal.h
-@@ -174,6 +174,7 @@ class Internals {
-   static const int kNodeStateMask = 0x7;
-   static const int kNodeStateIsWeakValue = 2;
-   static const int kNodeStateIsPendingValue = 3;
-+  static const int kNodeStateIsNearDeathValue = 4;
-   static const int kNodeIsIndependentShift = 3;
-   static const int kNodeIsActiveShift = 4;
- 
-diff --git a/include/v8.h b/include/v8.h
-index 011495aafd67337b7e0251e571ee2d79bdcfedb3..a497511e960a6b2c461803d75eb491536c2500d4 100644
---- a/include/v8.h
-+++ b/include/v8.h
-@@ -576,6 +576,10 @@ template <class T> class PersistentBase {
- 
-   V8_DEPRECATED("See MarkIndependent.", V8_INLINE bool IsIndependent() const);
- 
-+  /** Checks if the handle holds the only reference to an object. */
-+  V8_DEPRECATED("Garbage collection internal state should not be relied on.",
-+                V8_INLINE bool IsNearDeath() const);
-+
-   /** Returns true if the handle's reference is weak.  */
-   V8_INLINE bool IsWeak() const;
- 
-@@ -8559,6 +8563,17 @@ class V8_EXPORT Isolate {
-    */
-   void VisitHandlesWithClassIds(PersistentHandleVisitor* visitor);
- 
-+  /**
-+   * Iterates through all the persistent handles in the current isolate's heap
-+   * that have class_ids and are candidates to be marked as partially dependent
-+   * handles. This will visit handles to young objects created since the last
-+   * garbage collection but is free to visit an arbitrary superset of these
-+   * objects.
-+   */
-+  V8_DEPRECATED(
-+      "Use VisitHandlesWithClassIds",
-+      void VisitHandlesForPartialDependence(PersistentHandleVisitor* visitor));
-+
-   /**
-    * Iterates through all the persistent handles in the current isolate's heap
-    * that have class_ids and are weak to be marked as inactive if there is no
-@@ -9836,6 +9851,17 @@ bool PersistentBase<T>::IsIndependent() const {
-                         I::kNodeIsIndependentShift);
- }
- 
-+template <class T>
-+bool PersistentBase<T>::IsNearDeath() const {
-+  typedef internal::Internals I;
-+  if (this->IsEmpty()) return false;
-+  uint8_t node_state =
-+      I::GetNodeState(reinterpret_cast<internal::Address*>(this->val_));
-+  return node_state == I::kNodeStateIsNearDeathValue ||
-+      node_state == I::kNodeStateIsPendingValue;
-+}
-+
-+
- template <class T>
- bool PersistentBase<T>::IsWeak() const {
-   typedef internal::Internals I;
-diff --git a/src/api/api.cc b/src/api/api.cc
-index 0964a815793f3347e5326817e56e75cd851cea4d..a45520f4d4e93f28a87408f7a32ae52fbd772355 100644
---- a/src/api/api.cc
-+++ b/src/api/api.cc
-@@ -8629,6 +8629,15 @@ void Isolate::VisitHandlesWithClassIds(PersistentHandleVisitor* visitor) {
-   isolate->global_handles()->IterateAllRootsWithClassIds(visitor);
- }
- 
-+
-+void Isolate::VisitHandlesForPartialDependence(
-+    PersistentHandleVisitor* visitor) {
-+  i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
-+  i::DisallowHeapAllocation no_allocation;
-+  isolate->global_handles()->IterateAllYoungRootsWithClassIds(visitor);
-+}
-+
-+
- void Isolate::VisitWeakHandles(PersistentHandleVisitor* visitor) {
-   i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
-   i::DisallowHeapAllocation no_allocation;
-diff --git a/src/global-handles.cc b/src/global-handles.cc
-index b647cc6d55089e1c1835c0b7fd24bf84b3995ab4..e6e9943876f34ca3818b2525f229dc371851eb4f 100644
---- a/src/global-handles.cc
-+++ b/src/global-handles.cc
-@@ -380,6 +380,7 @@ class GlobalHandles::Node final : public NodeBase<GlobalHandles::Node> {
-                   Internals::kNodeStateMask);
-     STATIC_ASSERT(WEAK == Internals::kNodeStateIsWeakValue);
-     STATIC_ASSERT(PENDING == Internals::kNodeStateIsPendingValue);
-+    STATIC_ASSERT(NEAR_DEATH == Internals::kNodeStateIsNearDeathValue);
-     STATIC_ASSERT(static_cast<int>(IsIndependent::kShift) ==
-                   Internals::kNodeIsIndependentShift);
-     STATIC_ASSERT(static_cast<int>(IsActive::kShift) ==
-@@ -427,6 +428,11 @@ class GlobalHandles::Node final : public NodeBase<GlobalHandles::Node> {
-     flags_ = NodeWeaknessType::update(flags_, weakness_type);
-   }
- 
-+  bool IsNearDeath() const {
-+    // Check for PENDING to ensure correct answer when processing callbacks.
-+    return state() == PENDING || state() == NEAR_DEATH;
-+  }
-+
-   bool IsWeak() const { return state() == WEAK; }
- 
-   bool IsInUse() const { return state() != FREE; }
-@@ -814,6 +820,10 @@ void GlobalHandles::AnnotateStrongRetainer(Address* location,
-   Node::FromLocation(location)->AnnotateStrongRetainer(label);
- }
- 
-+bool GlobalHandles::IsNearDeath(Address* location) {
-+  return Node::FromLocation(location)->IsNearDeath();
-+}
-+
- bool GlobalHandles::IsWeak(Address* location) {
-   return Node::FromLocation(location)->IsWeak();
- }
-diff --git a/src/global-handles.h b/src/global-handles.h
-index 8d5bae1491d34311f9559cc70c68498416a326af..e7a0b834d8a70cb368499222687c5bca5b5b4560 100644
---- a/src/global-handles.h
-+++ b/src/global-handles.h
-@@ -73,6 +73,9 @@ class V8_EXPORT_PRIVATE GlobalHandles final {
-   // Clear the weakness of a global handle.
-   static void* ClearWeakness(Address* location);
- 
-+  // Tells whether global handle is near death.
-+  static bool IsNearDeath(Address* location);
-+
-   // Tells whether global handle is weak.
-   static bool IsWeak(Address* location);
- 
-diff --git a/test/cctest/heap/test-heap.cc b/test/cctest/heap/test-heap.cc
-index faad45cb4c11360487d97b04bdde0dce71d9e3cd..50a84514c9aa342c08c0d7c107112cafa219654e 100644
---- a/test/cctest/heap/test-heap.cc
-+++ b/test/cctest/heap/test-heap.cc
-@@ -527,9 +527,14 @@ TEST(WeakGlobalHandlesScavenge) {
- 
-   // Scavenge treats weak pointers as normal roots.
-   CcTest::CollectGarbage(NEW_SPACE);
-+
-   CHECK((*h1)->IsString());
-   CHECK((*h2)->IsHeapNumber());
-+
-   CHECK(!WeakPointerCleared);
-+  CHECK(!global_handles->IsNearDeath(h2.location()));
-+  CHECK(!global_handles->IsNearDeath(h1.location()));
-+
-   GlobalHandles::Destroy(h1.location());
-   GlobalHandles::Destroy(h2.location());
- }
-@@ -567,8 +572,11 @@ TEST(WeakGlobalUnmodifiedApiHandlesScavenge) {
-       &TestWeakGlobalHandleCallback, v8::WeakCallbackType::kParameter);
- 
-   CcTest::CollectGarbage(NEW_SPACE);
-+
-   CHECK((*h1)->IsHeapNumber());
-   CHECK(WeakPointerCleared);
-+  CHECK(!global_handles->IsNearDeath(h1.location()));
-+
-   GlobalHandles::Destroy(h1.location());
- }
- 
-@@ -605,7 +613,10 @@ TEST(WeakGlobalApiHandleModifiedMapScavenge) {
-       &TestWeakGlobalHandleCallback, v8::WeakCallbackType::kParameter);
- 
-   CcTest::CollectGarbage(NEW_SPACE);
-+
-   CHECK(!WeakPointerCleared);
-+  CHECK(!global_handles->IsNearDeath(h1.location()));
-+
-   GlobalHandles::Destroy(h1.location());
- }
- 
-@@ -646,7 +657,10 @@ TEST(WeakGlobalApiHandleWithElementsScavenge) {
-       &TestWeakGlobalHandleCallback, v8::WeakCallbackType::kParameter);
- 
-   CcTest::CollectGarbage(NEW_SPACE);
-+
-   CHECK(!WeakPointerCleared);
-+  CHECK(!global_handles->IsNearDeath(h1.location()));
-+
-   GlobalHandles::Destroy(h1.location());
- }
- 
-@@ -681,11 +695,17 @@ TEST(WeakGlobalHandlesMark) {
-   GlobalHandles::MakeWeak(
-       h2.location(), reinterpret_cast<void*>(&handle_and_id),
-       &TestWeakGlobalHandleCallback, v8::WeakCallbackType::kParameter);
-+  CHECK(!GlobalHandles::IsNearDeath(h1.location()));
-+  CHECK(!GlobalHandles::IsNearDeath(h2.location()));
- 
-   // Incremental marking potentially marked handles before they turned weak.
-   CcTest::CollectAllGarbage();
-+
-   CHECK((*h1)->IsString());
-+
-   CHECK(WeakPointerCleared);
-+  CHECK(!GlobalHandles::IsNearDeath(h1.location()));
-+
-   GlobalHandles::Destroy(h1.location());
- }
- 
-diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
-index af2026ed86b43d35998e1ce0e760b1622af1a8b5..7250e83ef39817162ef87374ffd474c182541bef 100644
---- a/test/cctest/test-api.cc
-+++ b/test/cctest/test-api.cc
-@@ -19812,6 +19812,43 @@ TEST(WrapperClassId) {
-   object.Reset();
- }
- 
-+
-+TEST(PersistentHandleInNewSpaceVisitor) {
-+  LocalContext context;
-+  v8::Isolate* isolate = context->GetIsolate();
-+  v8::HandleScope scope(isolate);
-+  v8::Persistent<v8::Object> object1(isolate, v8::Object::New(isolate));
-+  CHECK_EQ(0, object1.WrapperClassId());
-+  object1.SetWrapperClassId(42);
-+  CHECK_EQ(42, object1.WrapperClassId());
-+
-+  CcTest::CollectAllGarbage();
-+  CcTest::CollectAllGarbage();
-+
-+  v8::Persistent<v8::Object> object2(isolate, v8::Object::New(isolate));
-+  CHECK_EQ(0, object2.WrapperClassId());
-+  object2.SetWrapperClassId(42);
-+  CHECK_EQ(42, object2.WrapperClassId());
-+
-+  Visitor42 visitor(&object2);
-+#if __clang__
-+#pragma clang diagnostic push
-+#pragma clang diagnostic ignored "-Wdeprecated"
-+#endif
-+  // VisitHandlesForPartialDependence is marked deprecated. This test will be
-+  // removed with the API method.
-+  isolate->VisitHandlesForPartialDependence(&visitor);
-+#if __clang__
-+#pragma clang diagnostic pop
-+#endif
-+
-+  CHECK_EQ(1, visitor.counter_);
-+
-+  object1.Reset();
-+  object2.Reset();
-+}
-+
-+
- TEST(RegExp) {
-   LocalContext context;
-   v8::HandleScope scope(context->GetIsolate());

+ 0 - 142
patches/common/v8/revert_api_remove_deprecated_conversion_functions.patch

@@ -1,142 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Jeremy Apthorp <[email protected]>
-Date: Mon, 29 Apr 2019 14:16:31 -0700
-Subject: Revert "[api] Remove deprecated conversion functions"
-
-This reverts commit c76f377a990343b18953123c2726337b38c59812.
-
-diff --git a/include/v8.h b/include/v8.h
-index 0b517b7a469451952723e10ad834d94c2f17e3e3..8012a1935018dde4ec72fd3945457321be9f6319 100644
---- a/include/v8.h
-+++ b/include/v8.h
-@@ -2493,6 +2493,9 @@ class V8_EXPORT Value : public Data {
- 
-   V8_WARN_UNUSED_RESULT MaybeLocal<BigInt> ToBigInt(
-       Local<Context> context) const;
-+  V8_DEPRECATED("ToBoolean can never throw. Use Local version.",
-+                V8_WARN_UNUSED_RESULT MaybeLocal<Boolean> ToBoolean(
-+                    Local<Context> context) const);
-   V8_WARN_UNUSED_RESULT MaybeLocal<Number> ToNumber(
-       Local<Context> context) const;
-   V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
-@@ -2508,6 +2511,16 @@ class V8_EXPORT Value : public Data {
-   V8_WARN_UNUSED_RESULT MaybeLocal<Int32> ToInt32(Local<Context> context) const;
- 
-   Local<Boolean> ToBoolean(Isolate* isolate) const;
-+  V8_DEPRECATED("Use maybe version",
-+                Local<Number> ToNumber(Isolate* isolate) const);
-+  V8_DEPRECATED("Use maybe version",
-+                Local<String> ToString(Isolate* isolate) const);
-+  V8_DEPRECATED("Use maybe version",
-+                Local<Object> ToObject(Isolate* isolate) const);
-+  V8_DEPRECATED("Use maybe version",
-+                Local<Integer> ToInteger(Isolate* isolate) const);
-+  V8_DEPRECATED("Use maybe version",
-+                Local<Int32> ToInt32(Isolate* isolate) const);
- 
-   /**
-    * Attempts to convert a string to an array index.
-@@ -2518,6 +2531,9 @@ class V8_EXPORT Value : public Data {
- 
-   bool BooleanValue(Isolate* isolate) const;
- 
-+  V8_DEPRECATED("BooleanValue can never throw. Use Isolate version.",
-+                V8_WARN_UNUSED_RESULT Maybe<bool> BooleanValue(
-+                    Local<Context> context) const);
-   V8_WARN_UNUSED_RESULT Maybe<double> NumberValue(Local<Context> context) const;
-   V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue(
-       Local<Context> context) const;
-diff --git a/src/api/api.cc b/src/api/api.cc
-index 5202fc9f77559d2e25c71f8f81de3cccbb7ba891..92bcc561d50276b31d5bd988dfa7247aaef20a8d 100644
---- a/src/api/api.cc
-+++ b/src/api/api.cc
-@@ -3430,6 +3430,12 @@ MaybeLocal<String> Value::ToString(Local<Context> context) const {
-   RETURN_ESCAPED(result);
- }
- 
-+
-+Local<String> Value::ToString(Isolate* isolate) const {
-+  RETURN_TO_LOCAL_UNCHECKED(ToString(isolate->GetCurrentContext()), String);
-+}
-+
-+
- MaybeLocal<String> Value::ToDetailString(Local<Context> context) const {
-   i::Handle<i::Object> obj = Utils::OpenHandle(this);
-   if (obj->IsString()) return ToApiHandle<String>(obj);
-@@ -3451,6 +3457,11 @@ MaybeLocal<Object> Value::ToObject(Local<Context> context) const {
-   RETURN_ESCAPED(result);
- }
- 
-+
-+Local<v8::Object> Value::ToObject(Isolate* isolate) const {
-+  RETURN_TO_LOCAL_UNCHECKED(ToObject(isolate->GetCurrentContext()), Object);
-+}
-+
- MaybeLocal<BigInt> Value::ToBigInt(Local<Context> context) const {
-   i::Handle<i::Object> obj = Utils::OpenHandle(this);
-   if (obj->IsBigInt()) return ToApiHandle<BigInt>(obj);
-@@ -3467,6 +3478,11 @@ bool Value::BooleanValue(Isolate* v8_isolate) const {
-       reinterpret_cast<i::Isolate*>(v8_isolate));
- }
- 
-+MaybeLocal<Boolean> Value::ToBoolean(Local<Context> context) const {
-+  return ToBoolean(context->GetIsolate());
-+}
-+
-+
- Local<Boolean> Value::ToBoolean(Isolate* v8_isolate) const {
-   auto isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
-   return ToApiHandle<Boolean>(
-@@ -3484,6 +3500,12 @@ MaybeLocal<Number> Value::ToNumber(Local<Context> context) const {
-   RETURN_ESCAPED(result);
- }
- 
-+
-+Local<Number> Value::ToNumber(Isolate* isolate) const {
-+  RETURN_TO_LOCAL_UNCHECKED(ToNumber(isolate->GetCurrentContext()), Number);
-+}
-+
-+
- MaybeLocal<Integer> Value::ToInteger(Local<Context> context) const {
-   auto obj = Utils::OpenHandle(this);
-   if (obj->IsSmi()) return ToApiHandle<Integer>(obj);
-@@ -3495,6 +3517,12 @@ MaybeLocal<Integer> Value::ToInteger(Local<Context> context) const {
-   RETURN_ESCAPED(result);
- }
- 
-+
-+Local<Integer> Value::ToInteger(Isolate* isolate) const {
-+  RETURN_TO_LOCAL_UNCHECKED(ToInteger(isolate->GetCurrentContext()), Integer);
-+}
-+
-+
- MaybeLocal<Int32> Value::ToInt32(Local<Context> context) const {
-   auto obj = Utils::OpenHandle(this);
-   if (obj->IsSmi()) return ToApiHandle<Int32>(obj);
-@@ -3506,6 +3534,12 @@ MaybeLocal<Int32> Value::ToInt32(Local<Context> context) const {
-   RETURN_ESCAPED(result);
- }
- 
-+
-+Local<Int32> Value::ToInt32(Isolate* isolate) const {
-+  RETURN_TO_LOCAL_UNCHECKED(ToInt32(isolate->GetCurrentContext()), Int32);
-+}
-+
-+
- MaybeLocal<Uint32> Value::ToUint32(Local<Context> context) const {
-   auto obj = Utils::OpenHandle(this);
-   if (obj->IsSmi()) return ToApiHandle<Uint32>(obj);
-@@ -3733,6 +3767,13 @@ void v8::RegExp::CheckCast(v8::Value* that) {
-                   "Could not convert to regular expression");
- }
- 
-+
-+Maybe<bool> Value::BooleanValue(Local<Context> context) const {
-+  i::Isolate* isolate = reinterpret_cast<i::Isolate*>(context->GetIsolate());
-+  return Just(Utils::OpenHandle(this)->BooleanValue(isolate));
-+}
-+
-+
- Maybe<double> Value::NumberValue(Local<Context> context) const {
-   auto obj = Utils::OpenHandle(this);
-   if (obj->IsNumber()) return Just(obj->Number());

+ 0 - 550
patches/common/v8/revert_cctest_add_v8_export_private_to_arm_arm64_ports.patch

@@ -1,550 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Jeremy Apthorp <[email protected]>
-Date: Mon, 15 Apr 2019 18:06:12 -0700
-Subject: Revert "[cctest] Add V8_EXPORT_PRIVATE to arm/arm64 ports"
-
-This reverts commit 1a7d847cfac9a7363c59c980e47a7b7ff416e6da.
-
-diff --git a/src/arm/assembler-arm.h b/src/arm/assembler-arm.h
-index e3b079c32e8f8a29abfe117cba44d3b75f53c49d..e85d0108effe3abb3b88a1a41cce0234751759ef 100644
---- a/src/arm/assembler-arm.h
-+++ b/src/arm/assembler-arm.h
-@@ -79,7 +79,7 @@ enum Coprocessor {
- // Machine instruction Operands
- 
- // Class Operand represents a shifter operand in data processing instructions
--class V8_EXPORT_PRIVATE Operand {
-+class Operand {
-  public:
-   // immediate
-   V8_INLINE explicit Operand(int32_t immediate,
-@@ -185,8 +185,9 @@ class V8_EXPORT_PRIVATE Operand {
-   friend class Assembler;
- };
- 
-+
- // Class MemOperand represents a memory operand in load and store instructions
--class V8_EXPORT_PRIVATE MemOperand {
-+class MemOperand {
-  public:
-   // [rn +/- offset]      Offset/NegOffset
-   // [rn +/- offset]!     PreIndex/NegPreIndex
-@@ -242,9 +243,10 @@ class V8_EXPORT_PRIVATE MemOperand {
-   friend class Assembler;
- };
- 
-+
- // Class NeonMemOperand represents a memory operand in load and
- // store NEON instructions
--class V8_EXPORT_PRIVATE NeonMemOperand {
-+class NeonMemOperand {
-  public:
-   // [rn {:align}]       Offset
-   // [rn {:align}]!      PostIndex
-@@ -265,6 +267,7 @@ class V8_EXPORT_PRIVATE NeonMemOperand {
-   int align_;
- };
- 
-+
- // Class NeonListOperand represents a list of NEON registers
- class NeonListOperand {
-  public:
-@@ -1391,7 +1394,7 @@ class PatchingAssembler : public Assembler {
- // 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 V8_EXPORT_PRIVATE UseScratchRegisterScope {
-+class UseScratchRegisterScope {
-  public:
-   explicit UseScratchRegisterScope(Assembler* assembler);
-   ~UseScratchRegisterScope();
-diff --git a/src/arm64/assembler-arm64.h b/src/arm64/assembler-arm64.h
-index d814722e6a9eb7b156fc86592cd321682bb68974..2ccead398af4e16d1a1905060dee88f1adfeb2a2 100644
---- a/src/arm64/assembler-arm64.h
-+++ b/src/arm64/assembler-arm64.h
-@@ -49,7 +49,7 @@ class Immediate {
-   RelocInfo::Mode rmode() const { return rmode_; }
- 
-  private:
--  V8_EXPORT_PRIVATE void InitializeHandle(Handle<HeapObject> value);
-+  void InitializeHandle(Handle<HeapObject> value);
- 
-   int64_t value_;
-   RelocInfo::Mode rmode_;
-diff --git a/src/arm64/decoder-arm64.h b/src/arm64/decoder-arm64.h
-index 477a126344a50eb9cf29cce216792a53ae98393e..a89bf38980e711c16caaf7a0158e36480b8ba978 100644
---- a/src/arm64/decoder-arm64.h
-+++ b/src/arm64/decoder-arm64.h
-@@ -86,7 +86,7 @@ namespace internal {
- 
- // The Visitor interface. Disassembler and simulator (and other tools)
- // must provide implementations for all of these functions.
--class V8_EXPORT_PRIVATE DecoderVisitor {
-+class DecoderVisitor {
-  public:
-   virtual ~DecoderVisitor() {}
- 
-@@ -95,8 +95,9 @@ class V8_EXPORT_PRIVATE DecoderVisitor {
-   #undef DECLARE
- };
- 
-+
- // A visitor that dispatches to a list of visitors.
--class V8_EXPORT_PRIVATE DispatchingDecoderVisitor : public DecoderVisitor {
-+class DispatchingDecoderVisitor : public DecoderVisitor {
-  public:
-   DispatchingDecoderVisitor() {}
-   virtual ~DispatchingDecoderVisitor() {}
-@@ -141,6 +142,7 @@ class V8_EXPORT_PRIVATE DispatchingDecoderVisitor : public DecoderVisitor {
-   std::list<DecoderVisitor*> visitors_;
- };
- 
-+
- template<typename V>
- class Decoder : public V {
-  public:
-diff --git a/src/arm64/disasm-arm64.h b/src/arm64/disasm-arm64.h
-index 8e218b5cf80635ddfdef03c3366e692e5ec01c15..0edb2ea58343af0aab71f8e79310270f9e847914 100644
---- a/src/arm64/disasm-arm64.h
-+++ b/src/arm64/disasm-arm64.h
-@@ -14,7 +14,8 @@
- namespace v8 {
- namespace internal {
- 
--class V8_EXPORT_PRIVATE DisassemblingDecoder : public DecoderVisitor {
-+
-+class DisassemblingDecoder : public DecoderVisitor {
-  public:
-   DisassemblingDecoder();
-   DisassemblingDecoder(char* text_buffer, int buffer_size);
-@@ -79,7 +80,8 @@ class V8_EXPORT_PRIVATE DisassemblingDecoder : public DecoderVisitor {
-   bool own_buffer_;
- };
- 
--class V8_EXPORT_PRIVATE PrintDisassembler : public DisassemblingDecoder {
-+
-+class PrintDisassembler : public DisassemblingDecoder {
-  public:
-   explicit PrintDisassembler(FILE* stream) : stream_(stream) { }
-   ~PrintDisassembler() { }
-@@ -90,6 +92,7 @@ class V8_EXPORT_PRIVATE PrintDisassembler : public DisassemblingDecoder {
-   FILE *stream_;
- };
- 
-+
- }  // namespace internal
- }  // namespace v8
- 
-diff --git a/src/arm64/instructions-arm64-constants.cc b/src/arm64/instructions-arm64-constants.cc
-index 5c0d42a8c633738e2cae777114fde7aa8671a556..7559946cb165ec1fd8c1cfd0c9bd77cc0d582f86 100644
---- a/src/arm64/instructions-arm64-constants.cc
-+++ b/src/arm64/instructions-arm64-constants.cc
-@@ -4,7 +4,6 @@
- 
- #include <cstdint>
- #include "include/v8config.h"
--#include "src/base/macros.h"
- 
- namespace v8 {
- namespace internal {
-@@ -29,25 +28,23 @@ extern "C" {
- 
- extern const uint16_t kFP16PositiveInfinity = 0x7C00;
- extern const uint16_t kFP16NegativeInfinity = 0xFC00;
--V8_EXPORT_PRIVATE extern const uint32_t kFP32PositiveInfinity = 0x7F800000;
--V8_EXPORT_PRIVATE extern const uint32_t kFP32NegativeInfinity = 0xFF800000;
--V8_EXPORT_PRIVATE extern const uint64_t kFP64PositiveInfinity =
--    0x7FF0000000000000UL;
--V8_EXPORT_PRIVATE extern const uint64_t kFP64NegativeInfinity =
--    0xFFF0000000000000UL;
-+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).
--V8_EXPORT_PRIVATE extern const uint64_t kFP64SignallingNaN = 0x7FF000007F800001;
--V8_EXPORT_PRIVATE extern const uint32_t kFP32SignallingNaN = 0x7F800001;
-+extern const uint64_t kFP64SignallingNaN = 0x7FF000007F800001;
-+extern const uint32_t kFP32SignallingNaN = 0x7F800001;
- 
- // A similar value, but as a quiet NaN.
--V8_EXPORT_PRIVATE extern const uint64_t kFP64QuietNaN = 0x7FF800007FC00001;
--V8_EXPORT_PRIVATE extern const uint32_t kFP32QuietNaN = 0x7FC00001;
-+extern const uint64_t kFP64QuietNaN = 0x7FF800007FC00001;
-+extern const uint32_t kFP32QuietNaN = 0x7FC00001;
- 
- // The default NaN values (for FPCR.DN=1).
--V8_EXPORT_PRIVATE extern const uint64_t kFP64DefaultNaN = 0x7FF8000000000000UL;
--V8_EXPORT_PRIVATE extern const uint32_t kFP32DefaultNaN = 0x7FC00000;
-+extern const uint64_t kFP64DefaultNaN = 0x7FF8000000000000UL;
-+extern const uint32_t kFP32DefaultNaN = 0x7FC00000;
- extern const uint16_t kFP16DefaultNaN = 0x7E00;
- 
- #if defined(V8_OS_WIN)
-diff --git a/src/arm64/instructions-arm64.h b/src/arm64/instructions-arm64.h
-index 8514469227042b5740da73d42fc210a2282414e4..6f46e4b88c2e7c77f6fd58567e9aa2ae31a54246 100644
---- a/src/arm64/instructions-arm64.h
-+++ b/src/arm64/instructions-arm64.h
-@@ -26,23 +26,23 @@ extern "C" {
- 
- extern const float16 kFP16PositiveInfinity;
- extern const float16 kFP16NegativeInfinity;
--V8_EXPORT_PRIVATE extern const float kFP32PositiveInfinity;
--V8_EXPORT_PRIVATE extern const float kFP32NegativeInfinity;
--V8_EXPORT_PRIVATE extern const double kFP64PositiveInfinity;
--V8_EXPORT_PRIVATE extern const double kFP64NegativeInfinity;
-+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).
--V8_EXPORT_PRIVATE extern const double kFP64SignallingNaN;
--V8_EXPORT_PRIVATE extern const float kFP32SignallingNaN;
-+extern const double kFP64SignallingNaN;
-+extern const float kFP32SignallingNaN;
- 
- // A similar value, but as a quiet NaN.
--V8_EXPORT_PRIVATE extern const double kFP64QuietNaN;
--V8_EXPORT_PRIVATE extern const float kFP32QuietNaN;
-+extern const double kFP64QuietNaN;
-+extern const float kFP32QuietNaN;
- 
- // The default NaN values (for FPCR.DN=1).
--V8_EXPORT_PRIVATE extern const double kFP64DefaultNaN;
--V8_EXPORT_PRIVATE extern const float kFP32DefaultNaN;
-+extern const double kFP64DefaultNaN;
-+extern const float kFP32DefaultNaN;
- extern const float16 kFP16DefaultNaN;
- 
- #if defined(V8_OS_WIN)
-@@ -401,11 +401,11 @@ class Instruction {
-   // Find the PC offset encoded in this instruction. 'this' may be a branch or
-   // a PC-relative addressing instruction.
-   // The offset returned is unscaled.
--  V8_EXPORT_PRIVATE int64_t ImmPCOffset();
-+  int64_t ImmPCOffset();
- 
-   // Find the target of this instruction. 'this' may be a branch or a
-   // PC-relative addressing instruction.
--  V8_EXPORT_PRIVATE Instruction* ImmPCOffsetTarget();
-+  Instruction* ImmPCOffsetTarget();
- 
-   static bool IsValidImmPCOffset(ImmBranchType branch_type, ptrdiff_t offset);
-   bool IsTargetInImmPCOffsetRange(Instruction* target);
-diff --git a/src/arm64/macro-assembler-arm64.h b/src/arm64/macro-assembler-arm64.h
-index d345475f18a671879bcf6f5e9063cbcd5b20241b..bcdf1fdc26091b010421e06f5779c7f7791fb2cb 100644
---- a/src/arm64/macro-assembler-arm64.h
-+++ b/src/arm64/macro-assembler-arm64.h
-@@ -2082,7 +2082,7 @@ class InstructionAccurateScope {
- // 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 V8_EXPORT_PRIVATE UseScratchRegisterScope {
-+class UseScratchRegisterScope {
-  public:
-   explicit UseScratchRegisterScope(TurboAssembler* tasm)
-       : available_(tasm->TmpList()),
-diff --git a/src/arm64/register-arm64.h b/src/arm64/register-arm64.h
-index 54b927c3f407bfdaf69e8312360da9cd31c159d1..1da32ae6f4f0a9ee082a4e5c4e9871259a14cdef 100644
---- a/src/arm64/register-arm64.h
-+++ b/src/arm64/register-arm64.h
-@@ -316,14 +316,14 @@ VectorFormat ScalarFormatFromLaneSize(int lanesize);
- VectorFormat VectorFormatHalfWidthDoubleLanes(VectorFormat vform);
- VectorFormat VectorFormatFillQ(VectorFormat vform);
- VectorFormat ScalarFormatFromFormat(VectorFormat vform);
--V8_EXPORT_PRIVATE unsigned RegisterSizeInBitsFromFormat(VectorFormat vform);
-+unsigned RegisterSizeInBitsFromFormat(VectorFormat vform);
- unsigned RegisterSizeInBytesFromFormat(VectorFormat vform);
- int LaneSizeInBytesFromFormat(VectorFormat vform);
- unsigned LaneSizeInBitsFromFormat(VectorFormat vform);
- int LaneSizeInBytesLog2FromFormat(VectorFormat vform);
--V8_EXPORT_PRIVATE int LaneCountFromFormat(VectorFormat vform);
-+int LaneCountFromFormat(VectorFormat vform);
- int MaxLaneCountFromFormat(VectorFormat vform);
--V8_EXPORT_PRIVATE bool IsVectorFormat(VectorFormat vform);
-+bool IsVectorFormat(VectorFormat vform);
- int64_t MaxIntFromFormat(VectorFormat vform);
- int64_t MinIntFromFormat(VectorFormat vform);
- uint64_t MaxUintFromFormat(VectorFormat vform);
-@@ -529,7 +529,7 @@ bool AreAliased(const CPURegister& reg1, const CPURegister& reg2,
- // 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).
--V8_EXPORT_PRIVATE bool AreSameSizeAndType(
-+bool AreSameSizeAndType(
-     const CPURegister& reg1, const CPURegister& reg2 = NoCPUReg,
-     const CPURegister& reg3 = NoCPUReg, const CPURegister& reg4 = NoCPUReg,
-     const CPURegister& reg5 = NoCPUReg, const CPURegister& reg6 = NoCPUReg,
-@@ -546,10 +546,9 @@ bool AreSameFormat(const VRegister& reg1, const VRegister& reg2,
- // 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).
--V8_EXPORT_PRIVATE bool AreConsecutive(const VRegister& reg1,
--                                      const VRegister& reg2,
--                                      const VRegister& reg3 = NoVReg,
--                                      const VRegister& reg4 = NoVReg);
-+bool AreConsecutive(const VRegister& reg1, const VRegister& reg2,
-+                    const VRegister& reg3 = NoVReg,
-+                    const VRegister& reg4 = NoVReg);
- 
- typedef VRegister FloatRegister;
- typedef VRegister DoubleRegister;
-@@ -557,7 +556,7 @@ typedef VRegister Simd128Register;
- 
- // -----------------------------------------------------------------------------
- // Lists of registers.
--class V8_EXPORT_PRIVATE CPURegList {
-+class CPURegList {
-  public:
-   template <typename... CPURegisters>
-   explicit CPURegList(CPURegister reg0, CPURegisters... regs)
-diff --git a/src/arm64/simulator-arm64.h b/src/arm64/simulator-arm64.h
-index 2a5e25518badddd77febee11debdfb90868f8b8b..673ff8710cabad467fc08556ab96d3737c6d3e03 100644
---- a/src/arm64/simulator-arm64.h
-+++ b/src/arm64/simulator-arm64.h
-@@ -656,11 +656,10 @@ class Simulator : public DecoderVisitor, public SimulatorBase {
-     USE(size);
-   }
- 
--  V8_EXPORT_PRIVATE explicit Simulator(
--      Decoder<DispatchingDecoderVisitor>* decoder, Isolate* isolate = nullptr,
--      FILE* stream = stderr);
-+  explicit Simulator(Decoder<DispatchingDecoderVisitor>* decoder,
-+                     Isolate* isolate = nullptr, FILE* stream = stderr);
-   Simulator();
--  V8_EXPORT_PRIVATE ~Simulator();
-+  ~Simulator();
- 
-   // System functions.
- 
-@@ -745,7 +744,7 @@ class Simulator : public DecoderVisitor, public SimulatorBase {
-   // Accessor to the internal simulator stack area.
-   uintptr_t StackLimit(uintptr_t c_limit) const;
- 
--  V8_EXPORT_PRIVATE void ResetState();
-+  void ResetState();
- 
-   void DoRuntimeCall(Instruction* instr);
- 
-@@ -753,7 +752,7 @@ class Simulator : public DecoderVisitor, public SimulatorBase {
-   static const Instruction* kEndOfSimAddress;
-   void DecodeInstruction();
-   void Run();
--  V8_EXPORT_PRIVATE void RunFrom(Instruction* start);
-+  void RunFrom(Instruction* start);
- 
-   // Simulation helpers.
-   template <typename T>
-diff --git a/src/arm64/utils-arm64.h b/src/arm64/utils-arm64.h
-index 00ed1c20c31bd312fe02920713fb0b937f1fa30e..f57dc861731c5146e26702147841a75dd045efd8 100644
---- a/src/arm64/utils-arm64.h
-+++ b/src/arm64/utils-arm64.h
-@@ -33,8 +33,8 @@ int float16classify(float16 value);
- // Bit counting.
- int CountLeadingZeros(uint64_t value, int width);
- int CountLeadingSignBits(int64_t value, int width);
--V8_EXPORT_PRIVATE int CountTrailingZeros(uint64_t value, int width);
--V8_EXPORT_PRIVATE int CountSetBits(uint64_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);
-diff --git a/src/codegen/code-comments.h b/src/codegen/code-comments.h
-index f366cd5547885d9e5dca19dd9177322dc375fa7c..fb4d47b6ec4e8982951e96f0226dbaf25185545c 100644
---- a/src/codegen/code-comments.h
-+++ b/src/codegen/code-comments.h
-@@ -35,7 +35,7 @@ struct CodeCommentEntry {
- 
- class CodeCommentsWriter {
-  public:
--  V8_EXPORT_PRIVATE void Add(uint32_t pc_offset, std::string comment);
-+  void Add(uint32_t pc_offset, std::string comment);
-   void Emit(Assembler* assm);
-   size_t entry_count() const;
-   uint32_t section_size() const;
-diff --git a/src/diagnostics/disasm.h b/src/diagnostics/disasm.h
-index 2fe14f19321c67aaf1dd388472b14c8b5fbfe400..fcc38eb3b2242ce65f872636b9121c66f94b987a 100644
---- a/src/diagnostics/disasm.h
-+++ b/src/diagnostics/disasm.h
-@@ -14,7 +14,7 @@ typedef unsigned char byte;
- // Interface and default implementation for converting addresses and
- // register-numbers to text.  The default implementation is machine
- // specific.
--class V8_EXPORT_PRIVATE NameConverter {
-+class NameConverter {
-  public:
-   virtual ~NameConverter() = default;
-   virtual const char* NameOfCPURegister(int reg) const;
-@@ -34,6 +34,7 @@ class V8_EXPORT_PRIVATE NameConverter {
-   v8::internal::EmbeddedVector<char, 128> tmp_buffer_;
- };
- 
-+
- // A generic Disassembler interface
- class Disassembler {
-  public:
-@@ -55,8 +56,7 @@ class Disassembler {
- 
-   // Writes one disassembled instruction into 'buffer' (0-terminated).
-   // Returns the length of the disassembled machine instruction in bytes.
--  V8_EXPORT_PRIVATE int InstructionDecode(v8::internal::Vector<char> buffer,
--                                          byte* instruction);
-+  int InstructionDecode(v8::internal::Vector<char> buffer, byte* instruction);
- 
-   // Returns -1 if instruction does not mark the beginning of a constant pool,
-   // or the number of entries in the constant pool beginning here.
-diff --git a/src/diagnostics/disassembler.h b/src/diagnostics/disassembler.h
-index db1b8de69b8d0efff6a7f72094e2298a34753b8b..a58702f0d6bb572a666c0261c84c68a57afb390b 100644
---- a/src/diagnostics/disassembler.h
-+++ b/src/diagnostics/disassembler.h
-@@ -20,10 +20,8 @@ class Disassembler : public AllStatic {
-   // Instruction'.
-   // the code object is used for name resolution and may be null.
-   // TODO(titzer): accept a {WasmCodeManager*} if {isolate} is null
--  V8_EXPORT_PRIVATE static int Decode(Isolate* isolate, std::ostream* os,
--                                      byte* begin, byte* end,
--                                      CodeReference code = {},
--                                      Address current_pc = kNullAddress);
-+  static int Decode(Isolate* isolate, std::ostream* os, byte* begin, byte* end,
-+                    CodeReference code = {}, Address current_pc = kNullAddress);
- };
- 
- }  // namespace internal
-diff --git a/src/objects.cc b/src/objects.cc
-index c1ae7ac0640ddf72494d94a636b77084fe8493ae..f4957e844aea20d1fae87b81dba480f6c01faf5b 100644
---- a/src/objects.cc
-+++ b/src/objects.cc
-@@ -1239,7 +1239,7 @@ bool Object::ToInt32(int32_t* value) {
- // static constexpr object declarations need a definition to make the
- // compiler happy.
- constexpr Object Smi::kZero;
--V8_EXPORT_PRIVATE constexpr Object SharedFunctionInfo::kNoSharedNameSentinel;
-+constexpr Object SharedFunctionInfo::kNoSharedNameSentinel;
- 
- Handle<SharedFunctionInfo> FunctionTemplateInfo::GetOrCreateSharedFunctionInfo(
-     Isolate* isolate, Handle<FunctionTemplateInfo> info,
-diff --git a/src/objects/code.h b/src/objects/code.h
-index a23763d893bda0003016d84b8f6f8d2c21365fcb..a078d30f2d84e65b087a3bcaf88002f1007a8034 100644
---- a/src/objects/code.h
-+++ b/src/objects/code.h
-@@ -650,10 +650,9 @@ class DependentCode : public WeakFixedArray {
-   };
- 
-   // Register a code dependency of {cell} on {object}.
--  V8_EXPORT_PRIVATE static void InstallDependency(Isolate* isolate,
--                                                  const MaybeObjectHandle& code,
--                                                  Handle<HeapObject> object,
--                                                  DependencyGroup group);
-+  static void InstallDependency(Isolate* isolate, const MaybeObjectHandle& code,
-+                                Handle<HeapObject> object,
-+                                DependencyGroup group);
- 
-   void DeoptimizeDependentCodeGroup(Isolate* isolate, DependencyGroup group);
- 
-diff --git a/src/objects/shared-function-info.h b/src/objects/shared-function-info.h
-index 40d40e182917e4c7b9b6afec70c4735c89d7c5bb..e06c9eb74a8c3b8bbcaab8fb0b1f29d9f981ae46 100644
---- a/src/objects/shared-function-info.h
-+++ b/src/objects/shared-function-info.h
-@@ -221,9 +221,7 @@ class InterpreterData : public Struct {
- class SharedFunctionInfo : public HeapObject {
-  public:
-   NEVER_READ_ONLY_SPACE
--
--  V8_EXPORT_PRIVATE static constexpr Object const kNoSharedNameSentinel =
--      Smi::kZero;
-+  static constexpr Object const kNoSharedNameSentinel = Smi::kZero;
- 
-   // [name]: Returns shared name if it exists or an empty string otherwise.
-   inline String Name() const;
-diff --git a/src/objects/string.cc b/src/objects/string.cc
-index c5ae73b6273e8011fe4c80e34958f0b72c8862c4..8338876fba0cbef611f1e40d047d184d09e4c3dd 100644
---- a/src/objects/string.cc
-+++ b/src/objects/string.cc
-@@ -1626,8 +1626,5 @@ String ConsStringIterator::NextLeaf(bool* blew_stack) {
-   UNREACHABLE();
- }
- 
--template EXPORT_TEMPLATE_DEFINE(V8_EXPORT_PRIVATE) void String::WriteToFlat(
--    String source, uint16_t* sink, int from, int to);
--
- }  // namespace internal
- }  // namespace v8
-diff --git a/src/objects/string.h b/src/objects/string.h
-index c7e9460904afe50613d811363d5d4c1281796fad..5b152501196c7aff9311f07e7262e4919a3a2a30 100644
---- a/src/objects/string.h
-+++ b/src/objects/string.h
-@@ -6,7 +6,6 @@
- #define V8_OBJECTS_STRING_H_
- 
- #include "src/base/bits.h"
--#include "src/base/export-template.h"
- #include "src/objects/instance-type.h"
- #include "src/objects/name.h"
- #include "src/objects/smi.h"
-@@ -369,8 +368,8 @@ class String : public Name {
- 
-   // Helper function for flattening strings.
-   template <typename sinkchar>
--  EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE)
--  static void WriteToFlat(String source, sinkchar* sink, int from, int to);
-+  V8_EXPORT_PRIVATE static void WriteToFlat(String source, sinkchar* sink,
-+                                            int from, int to);
- 
-   static inline bool IsAscii(const char* chars, int length) {
-     return IsAscii(reinterpret_cast<const uint8_t*>(chars), length);
-@@ -456,11 +455,6 @@ class String : public Name {
-   OBJECT_CONSTRUCTORS(String, Name);
- };
- 
--// clang-format off
--extern template EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE)
--void String::WriteToFlat(String source, uint16_t* sink, int from, int to);
--// clang-format on
--
- class SubStringRange {
-  public:
-   inline SubStringRange(String string, const DisallowHeapAllocation& no_gc,
-diff --git a/src/regexp/jsregexp.h b/src/regexp/jsregexp.h
-index 9866caa900888273de74cfb012845748931d0fd0..4c7526a59342743f6068e5c61d24c8dad4efd43f 100644
---- a/src/regexp/jsregexp.h
-+++ b/src/regexp/jsregexp.h
-@@ -1513,8 +1513,7 @@ class RegExpEngine: public AllStatic {
- 
-   static bool TooMuchRegExpCode(Isolate* isolate, Handle<String> pattern);
- 
--  V8_EXPORT_PRIVATE static void DotPrint(const char* label, RegExpNode* node,
--                                         bool ignore_case);
-+  static void DotPrint(const char* label, RegExpNode* node, bool ignore_case);
- };
- 
- 
-diff --git a/src/wasm/wasm-module.h b/src/wasm/wasm-module.h
-index d31f5ff067c9b096a94705769c64586ffd546341..cce60d015af915e0984060dd2e84d6f7b46fc79a 100644
---- a/src/wasm/wasm-module.h
-+++ b/src/wasm/wasm-module.h
-@@ -120,7 +120,7 @@ struct WasmElemSegment {
- 
-   // Used in the {entries} vector to represent a `ref.null` entry in a passive
-   // segment.
--  V8_EXPORT_PRIVATE static const uint32_t kNullIndex = ~0u;
-+  static const uint32_t kNullIndex = ~0u;
- 
-   uint32_t table_index;
-   WasmInitExpr offset;
-diff --git a/test/cctest/parsing/test-parse-decision.cc b/test/cctest/parsing/test-parse-decision.cc
-index c5426e4243bb304079e048820d51d0e5914e695e..4d873cdbfedc7f2f61eff486d828fe020d00eedc 100644
---- a/test/cctest/parsing/test-parse-decision.cc
-+++ b/test/cctest/parsing/test-parse-decision.cc
-@@ -14,7 +14,6 @@
- #include "src/execution/isolate.h"
- #include "src/handles-inl.h"
- #include "src/objects-inl.h"
--#include "src/objects/shared-function-info-inl.h"
- #include "src/utils.h"
- 
- #include "test/cctest/cctest.h"

+ 0 - 1159
patches/common/v8/revert_reland_api_heap_remove_deprecated_persistent_apis.patch

@@ -1,1159 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Jeremy Apthorp <[email protected]>
-Date: Mon, 29 Apr 2019 13:52:07 -0700
-Subject: Revert "Reland "[api,heap] Remove deprecated Persistent APIs""
-
-This reverts commit 4214933c6bb4d1815f07a40eaf008cb1e37ef217.
-
-diff --git a/include/v8-internal.h b/include/v8-internal.h
-index ef13006d1379290053ec00f70433c9bdaaa1daff..fe2ce67e0df04e58502d73ca5ac81a86ee001494 100644
---- a/include/v8-internal.h
-+++ b/include/v8-internal.h
-@@ -174,6 +174,8 @@ class Internals {
-   static const int kNodeStateMask = 0x7;
-   static const int kNodeStateIsWeakValue = 2;
-   static const int kNodeStateIsPendingValue = 3;
-+  static const int kNodeIsIndependentShift = 3;
-+  static const int kNodeIsActiveShift = 4;
- 
-   static const int kFirstNonstringType = 0x40;
-   static const int kOddballType = 0x43;
-diff --git a/include/v8-util.h b/include/v8-util.h
-index 29d813e4274d16939b77e5e1d13f097c5e08b0af..24962607076f780105365700d5aff10336eb1dac 100644
---- a/include/v8-util.h
-+++ b/include/v8-util.h
-@@ -194,6 +194,14 @@ class PersistentValueMapBase {
-     return SetReturnValueFromVal(&returnValue, Traits::Get(&impl_, key));
-   }
- 
-+  /**
-+   * Call V8::RegisterExternallyReferencedObject with the map value for given
-+   * key.
-+   */
-+  V8_DEPRECATED(
-+      "Used TracedGlobal and EmbedderHeapTracer::RegisterEmbedderReference",
-+      inline void RegisterExternallyReferencedObject(K& key));
-+
-   /**
-    * Return value for key and remove it from the map.
-    */
-@@ -344,6 +352,16 @@ class PersistentValueMapBase {
-   const char* label_;
- };
- 
-+template <typename K, typename V, typename Traits>
-+inline void
-+PersistentValueMapBase<K, V, Traits>::RegisterExternallyReferencedObject(
-+    K& key) {
-+  assert(Contains(key));
-+  V8::RegisterExternallyReferencedObject(
-+      reinterpret_cast<internal::Address*>(FromVal(Traits::Get(&impl_, key))),
-+      reinterpret_cast<internal::Isolate*>(GetIsolate()));
-+}
-+
- template <typename K, typename V, typename Traits>
- class PersistentValueMap : public PersistentValueMapBase<K, V, Traits> {
-  public:
-diff --git a/include/v8.h b/include/v8.h
-index cb9da12b88bca393ea814a226da82ecae857d343..011495aafd67337b7e0251e571ee2d79bdcfedb3 100644
---- a/include/v8.h
-+++ b/include/v8.h
-@@ -544,6 +544,38 @@ template <class T> class PersistentBase {
-    */
-   V8_INLINE void AnnotateStrongRetainer(const char* label);
- 
-+  /**
-+   * Allows the embedder to tell the v8 garbage collector that a certain object
-+   * is alive. Only allowed when the embedder is asked to trace its heap by
-+   * EmbedderHeapTracer.
-+   */
-+  V8_DEPRECATED(
-+      "Used TracedGlobal and EmbedderHeapTracer::RegisterEmbedderReference",
-+      V8_INLINE void RegisterExternalReference(Isolate* isolate) const);
-+
-+  /**
-+   * Marks the reference to this object independent. Garbage collector is free
-+   * to ignore any object groups containing this object. Weak callback for an
-+   * independent handle should not assume that it will be preceded by a global
-+   * GC prologue callback or followed by a global GC epilogue callback.
-+   */
-+  V8_DEPRECATED(
-+      "Weak objects are always considered independent. "
-+      "Use TracedGlobal when trying to use EmbedderHeapTracer. "
-+      "Use a strong handle when trying to keep an object alive.",
-+      V8_INLINE void MarkIndependent());
-+
-+  /**
-+   * Marks the reference to this object as active. The scavenge garbage
-+   * collection should not reclaim the objects marked as active, even if the
-+   * object held by the handle is otherwise unreachable.
-+   *
-+   * This bit is cleared after the each garbage collection pass.
-+   */
-+  V8_DEPRECATED("Use TracedGlobal.", V8_INLINE void MarkActive());
-+
-+  V8_DEPRECATED("See MarkIndependent.", V8_INLINE bool IsIndependent() const);
-+
-   /** Returns true if the handle's reference is weak.  */
-   V8_INLINE bool IsWeak() const;
- 
-@@ -8847,6 +8879,9 @@ class V8_EXPORT V8 {
-                                      const char* label);
-   static Value* Eternalize(Isolate* isolate, Value* handle);
- 
-+  static void RegisterExternallyReferencedObject(internal::Address* location,
-+                                                 internal::Isolate* isolate);
-+
-   template <class K, class V, class T>
-   friend class PersistentValueMapBase;
- 
-@@ -9793,6 +9828,14 @@ void Persistent<T, M>::Copy(const Persistent<S, M2>& that) {
-   M::Copy(that, this);
- }
- 
-+template <class T>
-+bool PersistentBase<T>::IsIndependent() const {
-+  typedef internal::Internals I;
-+  if (this->IsEmpty()) return false;
-+  return I::GetNodeFlag(reinterpret_cast<internal::Address*>(this->val_),
-+                        I::kNodeIsIndependentShift);
-+}
-+
- template <class T>
- bool PersistentBase<T>::IsWeak() const {
-   typedef internal::Internals I;
-@@ -9859,6 +9902,31 @@ void PersistentBase<T>::AnnotateStrongRetainer(const char* label) {
-                              label);
- }
- 
-+template <class T>
-+void PersistentBase<T>::RegisterExternalReference(Isolate* isolate) const {
-+  if (IsEmpty()) return;
-+  V8::RegisterExternallyReferencedObject(
-+      reinterpret_cast<internal::Address*>(this->val_),
-+      reinterpret_cast<internal::Isolate*>(isolate));
-+}
-+
-+template <class T>
-+void PersistentBase<T>::MarkIndependent() {
-+  typedef internal::Internals I;
-+  if (this->IsEmpty()) return;
-+  I::UpdateNodeFlag(reinterpret_cast<internal::Address*>(this->val_), true,
-+                    I::kNodeIsIndependentShift);
-+}
-+
-+template <class T>
-+void PersistentBase<T>::MarkActive() {
-+  typedef internal::Internals I;
-+  if (this->IsEmpty()) return;
-+  I::UpdateNodeFlag(reinterpret_cast<internal::Address*>(this->val_), true,
-+                    I::kNodeIsActiveShift);
-+}
-+
-+
- template <class T>
- void PersistentBase<T>::SetWrapperClassId(uint16_t class_id) {
-   typedef internal::Internals I;
-diff --git a/src/api/api.cc b/src/api/api.cc
-index efaa78cd42945c0a9176a53d59364f488648418a..0964a815793f3347e5326817e56e75cd851cea4d 100644
---- a/src/api/api.cc
-+++ b/src/api/api.cc
-@@ -1044,6 +1044,11 @@ void V8::MoveTracedGlobalReference(internal::Address** from,
-   i::GlobalHandles::MoveTracedGlobal(from, to);
- }
- 
-+void V8::RegisterExternallyReferencedObject(i::Address* location,
-+                                            i::Isolate* isolate) {
-+  isolate->heap()->RegisterExternallyReferencedObject(location);
-+}
-+
- void V8::MakeWeak(i::Address* location, void* parameter,
-                   WeakCallbackInfo<void>::Callback weak_callback,
-                   WeakCallbackType type) {
-diff --git a/src/global-handles.cc b/src/global-handles.cc
-index ab6172836d38ad53b8b4f5d8d3cac5740ddd6788..b647cc6d55089e1c1835c0b7fd24bf84b3995ab4 100644
---- a/src/global-handles.cc
-+++ b/src/global-handles.cc
-@@ -380,6 +380,10 @@ class GlobalHandles::Node final : public NodeBase<GlobalHandles::Node> {
-                   Internals::kNodeStateMask);
-     STATIC_ASSERT(WEAK == Internals::kNodeStateIsWeakValue);
-     STATIC_ASSERT(PENDING == Internals::kNodeStateIsPendingValue);
-+    STATIC_ASSERT(static_cast<int>(IsIndependent::kShift) ==
-+                  Internals::kNodeIsIndependentShift);
-+    STATIC_ASSERT(static_cast<int>(IsActive::kShift) ==
-+                  Internals::kNodeIsActiveShift);
-     set_in_young_list(false);
-   }
- 
-@@ -403,6 +407,16 @@ class GlobalHandles::Node final : public NodeBase<GlobalHandles::Node> {
-     flags_ = NodeState::update(flags_, state);
-   }
- 
-+  bool is_independent() { return IsIndependent::decode(flags_); }
-+  void set_independent(bool v) { flags_ = IsIndependent::update(flags_, v); }
-+
-+  bool is_active() {
-+    return IsActive::decode(flags_);
-+  }
-+  void set_active(bool v) {
-+    flags_ = IsActive::update(flags_, v);
-+  }
-+
-   bool is_in_young_list() const { return IsInYoungList::decode(flags_); }
-   void set_in_young_list(bool v) { flags_ = IsInYoungList::update(flags_, v); }
- 
-@@ -549,6 +563,7 @@ class GlobalHandles::Node final : public NodeBase<GlobalHandles::Node> {
-     // This method invokes a finalizer. Updating the method name would require
-     // adjusting CFI blacklist as weak_callback_ is invoked on the wrong type.
-     CHECK(IsPendingFinalizer());
-+    CHECK(!is_active());
-     set_state(NEAR_DEATH);
-     // Check that we are not passing a finalized external string to
-     // the callback.
-@@ -579,17 +594,24 @@ class GlobalHandles::Node final : public NodeBase<GlobalHandles::Node> {
-  private:
-   // Fields that are not used for managing node memory.
-   void ClearImplFields() {
-+    set_independent(false);
-+    set_active(false);
-     weak_callback_ = nullptr;
-   }
- 
-   void CheckImplFieldsAreCleared() {
-+    DCHECK(!is_independent());
-+    DCHECK(!is_active());
-     DCHECK_EQ(nullptr, weak_callback_);
-   }
- 
-   // This stores three flags (independent, partially_dependent and
-   // in_young_list) and a State.
-   class NodeState : public BitField8<State, 0, 3> {};
--  class IsInYoungList : public BitField8<bool, NodeState::kNext, 1> {};
-+  class IsIndependent : public BitField8<bool, NodeState::kNext, 1> {};
-+  // The following two fields are mutually exclusive
-+  class IsActive : public BitField8<bool, IsIndependent::kNext, 1> {};
-+  class IsInYoungList : public BitField8<bool, IsActive::kNext, 1> {};
-   class NodeWeaknessType
-       : public BitField8<WeaknessType, IsInYoungList::kNext, 2> {};
- 
-@@ -852,6 +874,12 @@ void GlobalHandles::IterateWeakRootsIdentifyFinalizers(
- 
- void GlobalHandles::IdentifyWeakUnmodifiedObjects(
-     WeakSlotCallback is_unmodified) {
-+  for (Node* node : young_nodes_) {
-+    if (node->IsWeak() && !is_unmodified(node->location())) {
-+      node->set_active(true);
-+    }
-+  }
-+
-   LocalEmbedderHeapTracer* const tracer =
-       isolate()->heap()->local_embedder_heap_tracer();
-   for (TracedNode* node : traced_young_nodes_) {
-@@ -868,7 +896,9 @@ void GlobalHandles::IdentifyWeakUnmodifiedObjects(
- 
- void GlobalHandles::IterateYoungStrongAndDependentRoots(RootVisitor* v) {
-   for (Node* node : young_nodes_) {
--    if (node->IsStrongRetainer()) {
-+    if (node->IsStrongRetainer() ||
-+        (node->IsWeakRetainer() && !node->is_independent() &&
-+         node->is_active())) {
-       v->VisitRootPointer(Root::kGlobalHandles, node->label(),
-                           node->location());
-     }
-@@ -884,7 +914,8 @@ void GlobalHandles::MarkYoungWeakUnmodifiedObjectsPending(
-     WeakSlotCallbackWithHeap is_dead) {
-   for (Node* node : young_nodes_) {
-     DCHECK(node->is_in_young_list());
--    if (node->IsWeak() && is_dead(isolate_->heap(), node->location())) {
-+    if ((node->is_independent() || !node->is_active()) && node->IsWeak() &&
-+        is_dead(isolate_->heap(), node->location())) {
-       if (!node->IsPhantomCallback() && !node->IsPhantomResetHandle()) {
-         node->MarkPending();
-       }
-@@ -896,7 +927,8 @@ void GlobalHandles::IterateYoungWeakUnmodifiedRootsForFinalizers(
-     RootVisitor* v) {
-   for (Node* node : young_nodes_) {
-     DCHECK(node->is_in_young_list());
--    if (node->IsWeakRetainer() && (node->state() == Node::PENDING)) {
-+    if ((node->is_independent() || !node->is_active()) &&
-+        node->IsWeakRetainer() && (node->state() == Node::PENDING)) {
-       DCHECK(!node->IsPhantomCallback());
-       DCHECK(!node->IsPhantomResetHandle());
-       // Finalizers need to survive.
-@@ -910,7 +942,8 @@ void GlobalHandles::IterateYoungWeakUnmodifiedRootsForPhantomHandles(
-     RootVisitor* v, WeakSlotCallbackWithHeap should_reset_handle) {
-   for (Node* node : young_nodes_) {
-     DCHECK(node->is_in_young_list());
--    if (node->IsWeakRetainer() && (node->state() != Node::PENDING)) {
-+    if ((node->is_independent() || !node->is_active()) &&
-+        node->IsWeakRetainer() && (node->state() != Node::PENDING)) {
-       if (should_reset_handle(isolate_->heap(), node->location())) {
-         DCHECK(node->IsPhantomResetHandle() || node->IsPhantomCallback());
-         if (node->IsPhantomResetHandle()) {
-@@ -985,6 +1018,9 @@ size_t GlobalHandles::PostScavengeProcessing(unsigned post_processing_count) {
-     // Filter free nodes.
-     if (!node->IsRetainer()) continue;
- 
-+    // Reset active state for all affected nodes.
-+    node->set_active(false);
-+
-     if (node->IsPending()) {
-       DCHECK(node->has_callback());
-       DCHECK(node->IsPendingFinalizer());
-@@ -1003,6 +1039,9 @@ size_t GlobalHandles::PostMarkSweepProcessing(unsigned post_processing_count) {
-     // Filter free nodes.
-     if (!node->IsRetainer()) continue;
- 
-+    // Reset active state for all affected nodes.
-+    node->set_active(false);
-+
-     if (node->IsPending()) {
-       DCHECK(node->has_callback());
-       DCHECK(node->IsPendingFinalizer());
-diff --git a/src/profiler/sampling-heap-profiler.cc b/src/profiler/sampling-heap-profiler.cc
-index 2b22e673d7cfb4601a31f3d687eb5b3ba69be6c4..cd79b398b482ca31dcad8477d99a8b9a9644640c 100644
---- a/src/profiler/sampling-heap-profiler.cc
-+++ b/src/profiler/sampling-heap-profiler.cc
-@@ -92,6 +92,16 @@ void SamplingHeapProfiler::SampleObject(Address soon_object, size_t size) {
-       base::make_unique<Sample>(size, node, loc, this, next_sample_id());
-   sample->global.SetWeak(sample.get(), OnWeakCallback,
-                          WeakCallbackType::kParameter);
-+#if __clang__
-+#pragma clang diagnostic push
-+#pragma clang diagnostic ignored "-Wdeprecated"
-+#endif
-+  // MarkIndependent is marked deprecated but we still rely on it here
-+  // temporarily.
-+  sample->global.MarkIndependent();
-+#if __clang__
-+#pragma clang diagnostic pop
-+#endif
-   samples_.emplace(sample.get(), std::move(sample));
- }
- 
-diff --git a/test/cctest/heap/heap-utils.h b/test/cctest/heap/heap-utils.h
-index dfd4094913e84d3f04daea5896b34fd21107295b..375c2aeb13320cdc4faa3cdacaa71ac4e0db1896 100644
---- a/test/cctest/heap/heap-utils.h
-+++ b/test/cctest/heap/heap-utils.h
-@@ -12,22 +12,6 @@ namespace v8 {
- namespace internal {
- namespace heap {
- 
--class TemporaryEmbedderHeapTracerScope {
-- public:
--  TemporaryEmbedderHeapTracerScope(v8::Isolate* isolate,
--                                   v8::EmbedderHeapTracer* tracer)
--      : isolate_(isolate) {
--    isolate_->SetEmbedderHeapTracer(tracer);
--  }
--
--  ~TemporaryEmbedderHeapTracerScope() {
--    isolate_->SetEmbedderHeapTracer(nullptr);
--  }
--
-- private:
--  v8::Isolate* const isolate_;
--};
--
- void SealCurrentObjects(Heap* heap);
- 
- int FixedArrayLenFromSize(int size);
-diff --git a/test/cctest/heap/test-embedder-tracing.cc b/test/cctest/heap/test-embedder-tracing.cc
-index 022d605aff3b2eafa07be9075c1ff1645baecbfb..aa76386a22f234bb133e54a853e40b30d91e0b88 100644
---- a/test/cctest/heap/test-embedder-tracing.cc
-+++ b/test/cctest/heap/test-embedder-tracing.cc
-@@ -103,6 +103,22 @@ class TestEmbedderHeapTracer final : public v8::EmbedderHeapTracer {
-   v8::Global<v8::Array> array_;
- };
- 
-+class TemporaryEmbedderHeapTracerScope {
-+ public:
-+  TemporaryEmbedderHeapTracerScope(v8::Isolate* isolate,
-+                                   EmbedderHeapTracer* tracer)
-+      : isolate_(isolate) {
-+    isolate_->SetEmbedderHeapTracer(tracer);
-+  }
-+
-+  ~TemporaryEmbedderHeapTracerScope() {
-+    isolate_->SetEmbedderHeapTracer(nullptr);
-+  }
-+
-+ private:
-+  v8::Isolate* const isolate_;
-+};
-+
- }  // namespace
- 
- TEST(V8RegisteringEmbedderReference) {
-@@ -112,7 +128,7 @@ TEST(V8RegisteringEmbedderReference) {
-   CcTest::InitializeVM();
-   v8::Isolate* isolate = CcTest::isolate();
-   TestEmbedderHeapTracer tracer;
--  heap::TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
-+  TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
-   v8::HandleScope scope(isolate);
-   v8::Local<v8::Context> context = v8::Context::New(isolate);
-   v8::Context::Scope context_scope(context);
-@@ -132,7 +148,7 @@ TEST(EmbedderRegisteringV8Reference) {
-   CcTest::InitializeVM();
-   v8::Isolate* isolate = CcTest::isolate();
-   TestEmbedderHeapTracer tracer;
--  heap::TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
-+  TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
-   v8::HandleScope scope(isolate);
-   v8::Local<v8::Context> context = v8::Context::New(isolate);
-   v8::Context::Scope context_scope(context);
-@@ -165,7 +181,7 @@ TEST(TracingInRevivedSubgraph) {
-   CcTest::InitializeVM();
-   v8::Isolate* isolate = CcTest::isolate();
-   TestEmbedderHeapTracer tracer;
--  heap::TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
-+  TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
-   v8::HandleScope scope(isolate);
-   v8::Local<v8::Context> context = v8::Context::New(isolate);
-   v8::Context::Scope context_scope(context);
-@@ -193,7 +209,7 @@ TEST(TracingInEphemerons) {
-   CcTest::InitializeVM();
-   v8::Isolate* isolate = CcTest::isolate();
-   TestEmbedderHeapTracer tracer;
--  heap::TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
-+  TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
-   v8::HandleScope scope(isolate);
-   v8::Local<v8::Context> context = v8::Context::New(isolate);
-   v8::Context::Scope context_scope(context);
-@@ -224,7 +240,7 @@ TEST(FinalizeTracingIsNoopWhenNotMarking) {
-   v8::Isolate* isolate = CcTest::isolate();
-   Isolate* i_isolate = CcTest::i_isolate();
-   TestEmbedderHeapTracer tracer;
--  heap::TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
-+  TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
- 
-   // Finalize a potentially running garbage collection.
-   i_isolate->heap()->CollectGarbage(OLD_SPACE,
-@@ -243,7 +259,7 @@ TEST(FinalizeTracingWhenMarking) {
-   v8::Isolate* isolate = CcTest::isolate();
-   Isolate* i_isolate = CcTest::i_isolate();
-   TestEmbedderHeapTracer tracer;
--  heap::TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
-+  TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
- 
-   // Finalize a potentially running garbage collection.
-   i_isolate->heap()->CollectGarbage(OLD_SPACE,
-@@ -268,7 +284,7 @@ TEST(GarbageCollectionForTesting) {
-   v8::Isolate* isolate = CcTest::isolate();
-   Isolate* i_isolate = CcTest::i_isolate();
-   TestEmbedderHeapTracer tracer;
--  heap::TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
-+  TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
- 
-   int saved_gc_counter = i_isolate->heap()->gc_count();
-   tracer.GarbageCollectionForTesting(EmbedderHeapTracer::kUnknown);
-@@ -398,7 +414,7 @@ TEST(TracedGlobalToUnmodifiedJSObjectSurvivesScavengeWhenExcludedFromRoots) {
-   CcTest::InitializeVM();
-   v8::Isolate* isolate = CcTest::isolate();
-   TestEmbedderHeapTracer tracer;
--  heap::TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
-+  TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
-   tracer.ConsiderTracedGlobalAsRoot(false);
-   TracedGlobalTest(
-       CcTest::isolate(), ConstructJSObject,
-@@ -411,7 +427,7 @@ TEST(TracedGlobalToUnmodifiedJSApiObjectSurvivesScavengePerDefault) {
-   CcTest::InitializeVM();
-   v8::Isolate* isolate = CcTest::isolate();
-   TestEmbedderHeapTracer tracer;
--  heap::TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
-+  TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
-   tracer.ConsiderTracedGlobalAsRoot(true);
-   TracedGlobalTest(
-       CcTest::isolate(), ConstructJSApiObject,
-@@ -424,7 +440,7 @@ TEST(TracedGlobalToUnmodifiedJSApiObjectDiesOnScavengeWhenExcludedFromRoots) {
-   CcTest::InitializeVM();
-   v8::Isolate* isolate = CcTest::isolate();
-   TestEmbedderHeapTracer tracer;
--  heap::TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
-+  TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
-   tracer.ConsiderTracedGlobalAsRoot(false);
-   TracedGlobalTest(
-       CcTest::isolate(), ConstructJSApiObject,
-@@ -438,7 +454,7 @@ TEST(TracedGlobalWrapperClassId) {
-   v8::Isolate* isolate = CcTest::isolate();
-   v8::HandleScope scope(isolate);
-   TestEmbedderHeapTracer tracer;
--  heap::TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
-+  TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
- 
-   v8::TracedGlobal<v8::Object> traced;
-   ConstructJSObject(isolate, isolate->GetCurrentContext(), &traced);
-@@ -473,7 +489,7 @@ TEST(TracedGlobalIteration) {
-   v8::Isolate* isolate = CcTest::isolate();
-   v8::HandleScope scope(isolate);
-   TestEmbedderHeapTracer tracer;
--  heap::TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
-+  TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
- 
-   v8::TracedGlobal<v8::Object> traced;
-   ConstructJSObject(isolate, isolate->GetCurrentContext(), &traced);
-@@ -506,7 +522,7 @@ TEST(TracedGlobalSetFinalizationCallbackScavenge) {
-   v8::HandleScope scope(isolate);
-   TestEmbedderHeapTracer tracer;
-   tracer.ConsiderTracedGlobalAsRoot(false);
--  heap::TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
-+  TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
- 
-   v8::TracedGlobal<v8::Object> traced;
-   ConstructJSApiObject(isolate, isolate->GetCurrentContext(), &traced);
-@@ -528,7 +544,7 @@ TEST(TracedGlobalSetFinalizationCallbackMarkSweep) {
-   v8::Isolate* isolate = CcTest::isolate();
-   v8::HandleScope scope(isolate);
-   TestEmbedderHeapTracer tracer;
--  heap::TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
-+  TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
- 
-   v8::TracedGlobal<v8::Object> traced;
-   ConstructJSApiObject(isolate, isolate->GetCurrentContext(), &traced);
-@@ -558,7 +574,7 @@ TEST(TracePrologueCallingIntoV8WriteBarrier) {
-   }
-   TestEmbedderHeapTracer tracer(TracePrologueBehavior::kCallV8WriteBarrier,
-                                 std::move(global));
--  heap::TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
-+  TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
-   SimulateIncrementalMarking(CcTest::i_isolate()->heap());
- }
- 
-diff --git a/test/cctest/heap/test-heap.cc b/test/cctest/heap/test-heap.cc
-index 951c249c0ab909bef84e28221f682389c58d7b11..faad45cb4c11360487d97b04bdde0dce71d9e3cd 100644
---- a/test/cctest/heap/test-heap.cc
-+++ b/test/cctest/heap/test-heap.cc
-@@ -496,6 +496,44 @@ static void TestWeakGlobalHandleCallback(
-   p->first->Reset();
- }
- 
-+
-+TEST(WeakGlobalHandlesScavenge) {
-+  FLAG_stress_compaction = false;
-+  FLAG_stress_incremental_marking = false;
-+  CcTest::InitializeVM();
-+  Isolate* isolate = CcTest::i_isolate();
-+  Factory* factory = isolate->factory();
-+  GlobalHandles* global_handles = isolate->global_handles();
-+
-+  WeakPointerCleared = false;
-+
-+  Handle<Object> h1;
-+  Handle<Object> h2;
-+
-+  {
-+    HandleScope scope(isolate);
-+
-+    Handle<Object> i = factory->NewStringFromStaticChars("fisk");
-+    Handle<Object> u = factory->NewNumber(1.12344);
-+
-+    h1 = global_handles->Create(*i);
-+    h2 = global_handles->Create(*u);
-+  }
-+
-+  std::pair<Handle<Object>*, int> handle_and_id(&h2, 1234);
-+  GlobalHandles::MakeWeak(
-+      h2.location(), reinterpret_cast<void*>(&handle_and_id),
-+      &TestWeakGlobalHandleCallback, v8::WeakCallbackType::kParameter);
-+
-+  // Scavenge treats weak pointers as normal roots.
-+  CcTest::CollectGarbage(NEW_SPACE);
-+  CHECK((*h1)->IsString());
-+  CHECK((*h2)->IsHeapNumber());
-+  CHECK(!WeakPointerCleared);
-+  GlobalHandles::Destroy(h1.location());
-+  GlobalHandles::Destroy(h2.location());
-+}
-+
- TEST(WeakGlobalUnmodifiedApiHandlesScavenge) {
-   CcTest::InitializeVM();
-   Isolate* isolate = CcTest::i_isolate();
-@@ -534,6 +572,84 @@ TEST(WeakGlobalUnmodifiedApiHandlesScavenge) {
-   GlobalHandles::Destroy(h1.location());
- }
- 
-+TEST(WeakGlobalApiHandleModifiedMapScavenge) {
-+  CcTest::InitializeVM();
-+  Isolate* isolate = CcTest::i_isolate();
-+  LocalContext context;
-+  GlobalHandles* global_handles = isolate->global_handles();
-+
-+  WeakPointerCleared = false;
-+
-+  Handle<Object> h1;
-+
-+  {
-+    HandleScope scope(isolate);
-+
-+    // Create an API object which does not have the same map as constructor.
-+    auto function_template = FunctionTemplate::New(context->GetIsolate());
-+    auto instance_t = function_template->InstanceTemplate();
-+    instance_t->Set(v8::String::NewFromUtf8(context->GetIsolate(), "a",
-+                                            NewStringType::kNormal)
-+                        .ToLocalChecked(),
-+                    v8::Number::New(context->GetIsolate(), 10));
-+    auto function =
-+        function_template->GetFunction(context.local()).ToLocalChecked();
-+    auto i = function->NewInstance(context.local()).ToLocalChecked();
-+
-+    h1 = global_handles->Create(*(reinterpret_cast<internal::Address*>(*i)));
-+  }
-+
-+  std::pair<Handle<Object>*, int> handle_and_id(&h1, 1234);
-+  GlobalHandles::MakeWeak(
-+      h1.location(), reinterpret_cast<void*>(&handle_and_id),
-+      &TestWeakGlobalHandleCallback, v8::WeakCallbackType::kParameter);
-+
-+  CcTest::CollectGarbage(NEW_SPACE);
-+  CHECK(!WeakPointerCleared);
-+  GlobalHandles::Destroy(h1.location());
-+}
-+
-+TEST(WeakGlobalApiHandleWithElementsScavenge) {
-+  CcTest::InitializeVM();
-+  Isolate* isolate = CcTest::i_isolate();
-+  LocalContext context;
-+  GlobalHandles* global_handles = isolate->global_handles();
-+
-+  WeakPointerCleared = false;
-+
-+  Handle<Object> h1;
-+
-+  {
-+    HandleScope scope(isolate);
-+
-+    // Create an API object which has elements.
-+    auto function_template = FunctionTemplate::New(context->GetIsolate());
-+    auto instance_t = function_template->InstanceTemplate();
-+    instance_t->Set(v8::String::NewFromUtf8(context->GetIsolate(), "1",
-+                                            NewStringType::kNormal)
-+                        .ToLocalChecked(),
-+                    v8::Number::New(context->GetIsolate(), 10));
-+    instance_t->Set(v8::String::NewFromUtf8(context->GetIsolate(), "2",
-+                                            NewStringType::kNormal)
-+                        .ToLocalChecked(),
-+                    v8::Number::New(context->GetIsolate(), 10));
-+    auto function =
-+        function_template->GetFunction(context.local()).ToLocalChecked();
-+    auto i = function->NewInstance(context.local()).ToLocalChecked();
-+
-+    h1 = global_handles->Create(*(reinterpret_cast<internal::Address*>(*i)));
-+  }
-+
-+  std::pair<Handle<Object>*, int> handle_and_id(&h1, 1234);
-+  GlobalHandles::MakeWeak(
-+      h1.location(), reinterpret_cast<void*>(&handle_and_id),
-+      &TestWeakGlobalHandleCallback, v8::WeakCallbackType::kParameter);
-+
-+  CcTest::CollectGarbage(NEW_SPACE);
-+  CHECK(!WeakPointerCleared);
-+  GlobalHandles::Destroy(h1.location());
-+}
-+
- TEST(WeakGlobalHandlesMark) {
-   FLAG_stress_incremental_marking = false;
-   CcTest::InitializeVM();
-@@ -583,7 +699,9 @@ TEST(DeleteWeakGlobalHandle) {
-   GlobalHandles* global_handles = isolate->global_handles();
- 
-   WeakPointerCleared = false;
-+
-   Handle<Object> h;
-+
-   {
-     HandleScope scope(isolate);
- 
-@@ -595,8 +713,15 @@ TEST(DeleteWeakGlobalHandle) {
-   GlobalHandles::MakeWeak(h.location(), reinterpret_cast<void*>(&handle_and_id),
-                           &TestWeakGlobalHandleCallback,
-                           v8::WeakCallbackType::kParameter);
-+
-+  // Scanvenge does not recognize weak reference.
-+  CcTest::CollectGarbage(NEW_SPACE);
-+
-   CHECK(!WeakPointerCleared);
-+
-+  // Mark-compact treats weak reference properly.
-   CcTest::CollectGarbage(OLD_SPACE);
-+
-   CHECK(WeakPointerCleared);
- }
- 
-diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
-index 2118f34f1025125b746291af8830ddefd8b45c81..af2026ed86b43d35998e1ce0e760b1622af1a8b5 100644
---- a/test/cctest/test-api.cc
-+++ b/test/cctest/test-api.cc
-@@ -8089,6 +8089,18 @@ static void IndependentWeakHandle(bool global_gc, bool interlinked) {
-                           v8::WeakCallbackType::kParameter);
-   object_b.handle.SetWeak(&object_b, &SetFlag,
-                           v8::WeakCallbackType::kParameter);
-+#if __clang__
-+#pragma clang diagnostic push
-+#pragma clang diagnostic ignored "-Wdeprecated"
-+#endif
-+  // MarkIndependent is marked deprecated but we still rely on it temporarily.
-+  CHECK(!object_b.handle.IsIndependent());
-+  object_a.handle.MarkIndependent();
-+  object_b.handle.MarkIndependent();
-+  CHECK(object_b.handle.IsIndependent());
-+#if __clang__
-+#pragma clang diagnostic pop
-+#endif
-   if (global_gc) {
-     CcTest::CollectAllGarbage();
-   } else {
-@@ -8239,6 +8251,19 @@ void v8::internal::heap::HeapTester::ResetWeakHandle(bool global_gc) {
-                           v8::WeakCallbackType::kParameter);
-   object_b.handle.SetWeak(&object_b, &ResetUseValueAndSetFlag,
-                           v8::WeakCallbackType::kParameter);
-+  if (!global_gc) {
-+#if __clang__
-+#pragma clang diagnostic push
-+#pragma clang diagnostic ignored "-Wdeprecated"
-+#endif
-+    // MarkIndependent is marked deprecated but we still rely on it temporarily.
-+    object_a.handle.MarkIndependent();
-+    object_b.handle.MarkIndependent();
-+    CHECK(object_b.handle.IsIndependent());
-+#if __clang__
-+#pragma clang diagnostic pop
-+#endif
-+  }
-   if (global_gc) {
-     CcTest::PreciseCollectAllGarbage();
-   } else {
-@@ -8306,6 +8331,16 @@ THREADED_TEST(GCFromWeakCallbacks) {
-       object.flag = false;
-       object.handle.SetWeak(&object, gc_forcing_callback[inner_gc],
-                             v8::WeakCallbackType::kParameter);
-+#if __clang__
-+#pragma clang diagnostic push
-+#pragma clang diagnostic ignored "-Wdeprecated"
-+#endif
-+      // MarkIndependent is marked deprecated but we still rely on it
-+      // temporarily.
-+      object.handle.MarkIndependent();
-+#if __clang__
-+#pragma clang diagnostic pop
-+#endif
-       invoke_gc[outer_gc]();
-       EmptyMessageQueues(isolate);
-       CHECK(object.flag);
-diff --git a/test/cctest/test-global-handles.cc b/test/cctest/test-global-handles.cc
-index 3cf57b04b2fc9bfa2450d06954b179707527d68d..f2b9bb4cc5fe5f3ce62db3577e63c9ab7ed51609 100644
---- a/test/cctest/test-global-handles.cc
-+++ b/test/cctest/test-global-handles.cc
-@@ -39,25 +39,6 @@ namespace internal {
- 
- namespace {
- 
--// Empty v8::EmbedderHeapTracer that never keeps objects alive on Scavenge. See
--// |IsRootForNonTracingGC|.
--class NonRootingEmbedderHeapTracer final : public v8::EmbedderHeapTracer {
-- public:
--  NonRootingEmbedderHeapTracer() = default;
--
--  void RegisterV8References(
--      const std::vector<std::pair<void*, void*>>& embedder_fields) final {}
--  bool AdvanceTracing(double deadline_in_ms) final { return true; }
--  bool IsTracingDone() final { return true; }
--  void TracePrologue() final {}
--  void TraceEpilogue() final {}
--  void EnterFinalPause(EmbedderStackState) final {}
--
--  bool IsRootForNonTracingGC(const v8::TracedGlobal<v8::Value>& handle) final {
--    return false;
--  }
--};
--
- void InvokeScavenge() { CcTest::CollectGarbage(i::NEW_SPACE); }
- 
- void InvokeMarkSweep() { CcTest::CollectAllGarbage(); }
-@@ -66,23 +47,23 @@ void SimpleCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
-   info.GetReturnValue().Set(v8_num(0));
- }
- 
--struct FlagAndGlobal {
-+struct FlagAndPersistent {
-   bool flag;
-   v8::Global<v8::Object> handle;
- };
- 
--struct TracedGlobalWrapper {
--  v8::TracedGlobal<v8::Object> handle;
--};
--
--void ResetHandleAndSetFlag(const v8::WeakCallbackInfo<FlagAndGlobal>& data) {
-+void ResetHandleAndSetFlag(
-+    const v8::WeakCallbackInfo<FlagAndPersistent>& data) {
-   data.GetParameter()->handle.Reset();
-   data.GetParameter()->flag = true;
- }
- 
--template <typename HandleContainer>
-+using ConstructFunction = void (*)(v8::Isolate* isolate,
-+                                   v8::Local<v8::Context> context,
-+                                   FlagAndPersistent* flag_and_persistent);
-+
- void ConstructJSObject(v8::Isolate* isolate, v8::Local<v8::Context> context,
--                       HandleContainer* flag_and_persistent) {
-+                       FlagAndPersistent* flag_and_persistent) {
-   v8::HandleScope handle_scope(isolate);
-   v8::Local<v8::Object> object(v8::Object::New(isolate));
-   CHECK(!object.IsEmpty());
-@@ -98,9 +79,8 @@ void ConstructJSObject(v8::Isolate* isolate, v8::Global<v8::Object>* global) {
-   CHECK(!global->IsEmpty());
- }
- 
--template <typename HandleContainer>
- void ConstructJSApiObject(v8::Isolate* isolate, v8::Local<v8::Context> context,
--                          HandleContainer* flag_and_persistent) {
-+                          FlagAndPersistent* flag_and_persistent) {
-   v8::HandleScope handle_scope(isolate);
-   v8::Local<v8::FunctionTemplate> fun =
-       v8::FunctionTemplate::New(isolate, SimpleCallback);
-@@ -115,8 +95,7 @@ void ConstructJSApiObject(v8::Isolate* isolate, v8::Local<v8::Context> context,
- 
- enum class SurvivalMode { kSurvives, kDies };
- 
--template <typename ConstructFunction, typename ModifierFunction,
--          typename GCFunction>
-+template <typename ModifierFunction, typename GCFunction>
- void WeakHandleTest(v8::Isolate* isolate, ConstructFunction construct_function,
-                     ModifierFunction modifier_function, GCFunction gc_function,
-                     SurvivalMode survives) {
-@@ -124,7 +103,7 @@ void WeakHandleTest(v8::Isolate* isolate, ConstructFunction construct_function,
-   v8::Local<v8::Context> context = v8::Context::New(isolate);
-   v8::Context::Scope context_scope(context);
- 
--  FlagAndGlobal fp;
-+  FlagAndPersistent fp;
-   construct_function(isolate, context, &fp);
-   CHECK(heap::InYoungGeneration(isolate, fp.handle));
-   fp.handle.SetWeak(&fp, &ResetHandleAndSetFlag,
-@@ -136,28 +115,6 @@ void WeakHandleTest(v8::Isolate* isolate, ConstructFunction construct_function,
-   CHECK_IMPLIES(survives == SurvivalMode::kDies, fp.flag);
- }
- 
--template <typename ConstructFunction, typename ModifierFunction,
--          typename GCFunction>
--void TracedGlobalTest(v8::Isolate* isolate,
--                      ConstructFunction construct_function,
--                      ModifierFunction modifier_function,
--                      GCFunction gc_function, SurvivalMode survives) {
--  v8::HandleScope scope(isolate);
--  v8::Local<v8::Context> context = v8::Context::New(isolate);
--  v8::Context::Scope context_scope(context);
--
--  NonRootingEmbedderHeapTracer tracer;
--  heap::TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
--
--  TracedGlobalWrapper fp;
--  construct_function(isolate, context, &fp);
--  CHECK(heap::InYoungGeneration(isolate, fp.handle));
--  modifier_function(&fp);
--  gc_function();
--  CHECK_IMPLIES(survives == SurvivalMode::kSurvives, !fp.handle.IsEmpty());
--  CHECK_IMPLIES(survives == SurvivalMode::kDies, fp.handle.IsEmpty());
--}
--
- void ResurrectingFinalizer(
-     const v8::WeakCallbackInfo<v8::Global<v8::Object>>& data) {
-   data.GetParameter()->ClearWeak();
-@@ -320,36 +277,25 @@ TEST(PhatomHandlesWithoutCallbacks) {
-   CHECK_EQ(0u, isolate->NumberOfPhantomHandleResetsSinceLastCall());
- }
- 
--TEST(WeakHandleToUnmodifiedJSObjectDiesOnScavenge) {
-+TEST(WeakHandleToUnmodifiedJSObjectSurvivesScavenge) {
-   CcTest::InitializeVM();
-   WeakHandleTest(
--      CcTest::isolate(), &ConstructJSObject<FlagAndGlobal>,
--      [](FlagAndGlobal* fp) {}, []() { InvokeScavenge(); },
--      SurvivalMode::kDies);
--}
--
--TEST(TracedGlobalToUnmodifiedJSObjectSurvivesScavenge) {
--  ManualGCScope manual_gc;
--  CcTest::InitializeVM();
--  TracedGlobalTest(
--      CcTest::isolate(), &ConstructJSObject<TracedGlobalWrapper>,
--      [](TracedGlobalWrapper* fp) {}, []() { InvokeScavenge(); },
--      SurvivalMode::kSurvives);
-+      CcTest::isolate(), &ConstructJSObject, [](FlagAndPersistent* fp) {},
-+      []() { InvokeScavenge(); }, SurvivalMode::kSurvives);
- }
- 
- TEST(WeakHandleToUnmodifiedJSObjectDiesOnMarkCompact) {
-   CcTest::InitializeVM();
-   WeakHandleTest(
--      CcTest::isolate(), &ConstructJSObject<FlagAndGlobal>,
--      [](FlagAndGlobal* fp) {}, []() { InvokeMarkSweep(); },
--      SurvivalMode::kDies);
-+      CcTest::isolate(), &ConstructJSObject, [](FlagAndPersistent* fp) {},
-+      []() { InvokeMarkSweep(); }, SurvivalMode::kDies);
- }
- 
- TEST(WeakHandleToUnmodifiedJSObjectSurvivesMarkCompactWhenInHandle) {
-   CcTest::InitializeVM();
-   WeakHandleTest(
--      CcTest::isolate(), &ConstructJSObject<FlagAndGlobal>,
--      [](FlagAndGlobal* fp) {
-+      CcTest::isolate(), &ConstructJSObject,
-+      [](FlagAndPersistent* fp) {
-         v8::Local<v8::Object> handle =
-             v8::Local<v8::Object>::New(CcTest::isolate(), fp->handle);
-         USE(handle);
-@@ -360,30 +306,19 @@ TEST(WeakHandleToUnmodifiedJSObjectSurvivesMarkCompactWhenInHandle) {
- TEST(WeakHandleToUnmodifiedJSApiObjectDiesOnScavenge) {
-   CcTest::InitializeVM();
-   WeakHandleTest(
--      CcTest::isolate(), &ConstructJSApiObject<FlagAndGlobal>,
--      [](FlagAndGlobal* fp) {}, []() { InvokeScavenge(); },
--      SurvivalMode::kDies);
--}
--
--TEST(TracedGlobalToUnmodifiedJSApiObjectDiesOnScavenge) {
--  ManualGCScope manual_gc;
--  CcTest::InitializeVM();
--  TracedGlobalTest(
--      CcTest::isolate(), &ConstructJSApiObject<TracedGlobalWrapper>,
--      [](TracedGlobalWrapper* fp) {}, []() { InvokeScavenge(); },
--      SurvivalMode::kDies);
-+      CcTest::isolate(), &ConstructJSApiObject, [](FlagAndPersistent* fp) {},
-+      []() { InvokeScavenge(); }, SurvivalMode::kDies);
- }
- 
--TEST(TracedGlobalToJSApiObjectWithIdentityHashSurvivesScavenge) {
--  ManualGCScope manual_gc;
-+TEST(WeakHandleToJSApiObjectWithIdentityHashSurvivesScavenge) {
-   CcTest::InitializeVM();
-   Isolate* i_isolate = CcTest::i_isolate();
-   HandleScope scope(i_isolate);
-   Handle<JSWeakMap> weakmap = i_isolate->factory()->NewJSWeakMap();
- 
--  TracedGlobalTest(
--      CcTest::isolate(), &ConstructJSApiObject<TracedGlobalWrapper>,
--      [&weakmap, i_isolate](TracedGlobalWrapper* fp) {
-+  WeakHandleTest(
-+      CcTest::isolate(), &ConstructJSApiObject,
-+      [&weakmap, i_isolate](FlagAndPersistent* fp) {
-         v8::HandleScope scope(CcTest::isolate());
-         Handle<JSReceiver> key =
-             Utils::OpenHandle(*fp->handle.Get(CcTest::isolate()));
-@@ -397,8 +332,8 @@ TEST(TracedGlobalToJSApiObjectWithIdentityHashSurvivesScavenge) {
- TEST(WeakHandleToUnmodifiedJSApiObjectSurvivesScavengeWhenInHandle) {
-   CcTest::InitializeVM();
-   WeakHandleTest(
--      CcTest::isolate(), &ConstructJSApiObject<FlagAndGlobal>,
--      [](FlagAndGlobal* fp) {
-+      CcTest::isolate(), &ConstructJSApiObject,
-+      [](FlagAndPersistent* fp) {
-         v8::Local<v8::Object> handle =
-             v8::Local<v8::Object>::New(CcTest::isolate(), fp->handle);
-         USE(handle);
-@@ -409,16 +344,15 @@ TEST(WeakHandleToUnmodifiedJSApiObjectSurvivesScavengeWhenInHandle) {
- TEST(WeakHandleToUnmodifiedJSApiObjectDiesOnMarkCompact) {
-   CcTest::InitializeVM();
-   WeakHandleTest(
--      CcTest::isolate(), &ConstructJSApiObject<FlagAndGlobal>,
--      [](FlagAndGlobal* fp) {}, []() { InvokeMarkSweep(); },
--      SurvivalMode::kDies);
-+      CcTest::isolate(), &ConstructJSApiObject, [](FlagAndPersistent* fp) {},
-+      []() { InvokeMarkSweep(); }, SurvivalMode::kDies);
- }
- 
- TEST(WeakHandleToUnmodifiedJSApiObjectSurvivesMarkCompactWhenInHandle) {
-   CcTest::InitializeVM();
-   WeakHandleTest(
--      CcTest::isolate(), &ConstructJSApiObject<FlagAndGlobal>,
--      [](FlagAndGlobal* fp) {
-+      CcTest::isolate(), &ConstructJSApiObject,
-+      [](FlagAndPersistent* fp) {
-         v8::Local<v8::Object> handle =
-             v8::Local<v8::Object>::New(CcTest::isolate(), fp->handle);
-         USE(handle);
-@@ -426,57 +360,58 @@ TEST(WeakHandleToUnmodifiedJSApiObjectSurvivesMarkCompactWhenInHandle) {
-       []() { InvokeMarkSweep(); }, SurvivalMode::kSurvives);
- }
- 
--TEST(TracedGlobalToJSApiObjectWithModifiedMapSurvivesScavenge) {
-+TEST(WeakHandleToActiveUnmodifiedJSApiObjectSurvivesScavenge) {
-   CcTest::InitializeVM();
--  v8::Isolate* isolate = CcTest::isolate();
--  LocalContext context;
--
--  TracedGlobal<v8::Object> handle;
--  {
--    v8::HandleScope scope(isolate);
--    // Create an API object which does not have the same map as constructor.
--    auto function_template = FunctionTemplate::New(isolate);
--    auto instance_t = function_template->InstanceTemplate();
--    instance_t->Set(
--        v8::String::NewFromUtf8(isolate, "a", NewStringType::kNormal)
--            .ToLocalChecked(),
--        v8::Number::New(isolate, 10));
--    auto function =
--        function_template->GetFunction(context.local()).ToLocalChecked();
--    auto i = function->NewInstance(context.local()).ToLocalChecked();
--    handle.Reset(isolate, i);
--  }
--  InvokeScavenge();
--  CHECK(!handle.IsEmpty());
-+  WeakHandleTest(
-+      CcTest::isolate(), &ConstructJSApiObject,
-+      [](FlagAndPersistent* fp) {
-+#if __clang__
-+#pragma clang diagnostic push
-+#pragma clang diagnostic ignored "-Wdeprecated"
-+#endif
-+        fp->handle.MarkActive();
-+#if __clang__
-+#pragma clang diagnostic pop
-+#endif
-+      },
-+      []() { InvokeScavenge(); }, SurvivalMode::kSurvives);
- }
- 
--TEST(TracedGlobalTOJsApiObjectWithElementsSurvivesScavenge) {
-+TEST(WeakHandleToActiveUnmodifiedJSApiObjectDiesOnMarkCompact) {
-   CcTest::InitializeVM();
--  v8::Isolate* isolate = CcTest::isolate();
--  LocalContext context;
--
--  TracedGlobal<v8::Object> handle;
--  {
--    v8::HandleScope scope(isolate);
-+  WeakHandleTest(
-+      CcTest::isolate(), &ConstructJSApiObject,
-+      [](FlagAndPersistent* fp) {
-+#if __clang__
-+#pragma clang diagnostic push
-+#pragma clang diagnostic ignored "-Wdeprecated"
-+#endif
-+        fp->handle.MarkActive();
-+#if __clang__
-+#pragma clang diagnostic pop
-+#endif
-+      },
-+      []() { InvokeMarkSweep(); }, SurvivalMode::kDies);
-+}
- 
--    // Create an API object which has elements.
--    auto function_template = FunctionTemplate::New(isolate);
--    auto instance_t = function_template->InstanceTemplate();
--    instance_t->Set(
--        v8::String::NewFromUtf8(isolate, "1", NewStringType::kNormal)
--            .ToLocalChecked(),
--        v8::Number::New(isolate, 10));
--    instance_t->Set(
--        v8::String::NewFromUtf8(isolate, "2", NewStringType::kNormal)
--            .ToLocalChecked(),
--        v8::Number::New(isolate, 10));
--    auto function =
--        function_template->GetFunction(context.local()).ToLocalChecked();
--    auto i = function->NewInstance(context.local()).ToLocalChecked();
--    handle.Reset(isolate, i);
--  }
--  InvokeScavenge();
--  CHECK(!handle.IsEmpty());
-+TEST(WeakHandleToActiveUnmodifiedJSApiObjectSurvivesMarkCompactWhenInHandle) {
-+  CcTest::InitializeVM();
-+  WeakHandleTest(
-+      CcTest::isolate(), &ConstructJSApiObject,
-+      [](FlagAndPersistent* fp) {
-+#if __clang__
-+#pragma clang diagnostic push
-+#pragma clang diagnostic ignored "-Wdeprecated"
-+#endif
-+        fp->handle.MarkActive();
-+#if __clang__
-+#pragma clang diagnostic pop
-+#endif
-+        v8::Local<v8::Object> handle =
-+            v8::Local<v8::Object>::New(CcTest::isolate(), fp->handle);
-+        USE(handle);
-+      },
-+      []() { InvokeMarkSweep(); }, SurvivalMode::kSurvives);
- }
- 
- TEST(FinalizerOnUnmodifiedJSApiObjectDoesNotCrash) {
-@@ -487,7 +422,8 @@ TEST(FinalizerOnUnmodifiedJSApiObjectDoesNotCrash) {
-   v8::Local<v8::Context> context = v8::Context::New(isolate);
-   v8::Context::Scope context_scope(context);
- 
--  FlagAndGlobal fp;
-+  FlagAndPersistent fp;
-+  // Could use a regular object and MarkIndependent too.
-   ConstructJSApiObject(isolate, context, &fp);
-   fp.handle.SetWeak(&fp, &ResetHandleAndSetFlag,
-                     v8::WeakCallbackType::kFinalizer);
-@@ -559,22 +495,22 @@ TEST(FinalizerDiesAndKeepsPhantomAliveOnMarkCompact) {
- 
- namespace {
- 
--void ForceScavenge2(const v8::WeakCallbackInfo<FlagAndGlobal>& data) {
-+void ForceScavenge2(const v8::WeakCallbackInfo<FlagAndPersistent>& data) {
-   data.GetParameter()->flag = true;
-   InvokeScavenge();
- }
- 
--void ForceScavenge1(const v8::WeakCallbackInfo<FlagAndGlobal>& data) {
-+void ForceScavenge1(const v8::WeakCallbackInfo<FlagAndPersistent>& data) {
-   data.GetParameter()->handle.Reset();
-   data.SetSecondPassCallback(ForceScavenge2);
- }
- 
--void ForceMarkSweep2(const v8::WeakCallbackInfo<FlagAndGlobal>& data) {
-+void ForceMarkSweep2(const v8::WeakCallbackInfo<FlagAndPersistent>& data) {
-   data.GetParameter()->flag = true;
-   InvokeMarkSweep();
- }
- 
--void ForceMarkSweep1(const v8::WeakCallbackInfo<FlagAndGlobal>& data) {
-+void ForceMarkSweep1(const v8::WeakCallbackInfo<FlagAndPersistent>& data) {
-   data.GetParameter()->handle.Reset();
-   data.SetSecondPassCallback(ForceMarkSweep2);
- }
-@@ -589,7 +525,7 @@ TEST(GCFromWeakCallbacks) {
-   v8::Context::Scope context_scope(context);
- 
-   static const int kNumberOfGCTypes = 2;
--  typedef v8::WeakCallbackInfo<FlagAndGlobal>::Callback Callback;
-+  typedef v8::WeakCallbackInfo<FlagAndPersistent>::Callback Callback;
-   Callback gc_forcing_callback[kNumberOfGCTypes] = {&ForceScavenge1,
-                                                     &ForceMarkSweep1};
- 
-@@ -598,7 +534,7 @@ TEST(GCFromWeakCallbacks) {
- 
-   for (int outer_gc = 0; outer_gc < kNumberOfGCTypes; outer_gc++) {
-     for (int inner_gc = 0; inner_gc < kNumberOfGCTypes; inner_gc++) {
--      FlagAndGlobal fp;
-+      FlagAndPersistent fp;
-       ConstructJSApiObject(isolate, context, &fp);
-       CHECK(heap::InYoungGeneration(isolate, fp.handle));
-       fp.flag = false;
-@@ -613,11 +549,11 @@ TEST(GCFromWeakCallbacks) {
- 
- namespace {
- 
--void SecondPassCallback(const v8::WeakCallbackInfo<FlagAndGlobal>& data) {
-+void SecondPassCallback(const v8::WeakCallbackInfo<FlagAndPersistent>& data) {
-   data.GetParameter()->flag = true;
- }
- 
--void FirstPassCallback(const v8::WeakCallbackInfo<FlagAndGlobal>& data) {
-+void FirstPassCallback(const v8::WeakCallbackInfo<FlagAndPersistent>& data) {
-   data.GetParameter()->handle.Reset();
-   data.SetSecondPassCallback(SecondPassCallback);
- }
-@@ -630,7 +566,7 @@ TEST(SecondPassPhantomCallbacks) {
-   v8::HandleScope scope(isolate);
-   v8::Local<v8::Context> context = v8::Context::New(isolate);
-   v8::Context::Scope context_scope(context);
--  FlagAndGlobal fp;
-+  FlagAndPersistent fp;
-   ConstructJSApiObject(isolate, context, &fp);
-   fp.flag = false;
-   fp.handle.SetWeak(&fp, FirstPassCallback, v8::WeakCallbackType::kParameter);

+ 1 - 1
patches/common/v8/workaround_an_undefined_symbol_error.patch

@@ -39,7 +39,7 @@ index 4408a44770bcc5106bc2dd843ef4954dad7ff7df..df9683fd5e9720255ff6b83e47ec64e2
                         const Operand& operand, FlagsUpdate S, AddSubOp op) {
    DCHECK_EQ(rd.SizeInBits(), rn.SizeInBits());
 diff --git a/src/arm64/assembler-arm64.h b/src/arm64/assembler-arm64.h
-index 2ccead398af4e16d1a1905060dee88f1adfeb2a2..f0ac332c21eb1172324f728c74ae40e131763fd1 100644
+index 019295a527d29c2c00c3d092064a3ddde8b45263..ff832ce687e404572474c619f205ec826f2f2c1e 100644
 --- a/src/arm64/assembler-arm64.h
 +++ b/src/arm64/assembler-arm64.h
 @@ -2230,11 +2230,7 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase {