Wayland patches update

This commit is contained in:
Martin Stransky 2019-02-05 15:49:40 +01:00
parent 3b76d3a3ed
commit 7b002e873e
7 changed files with 3406 additions and 3063 deletions

View File

@ -1,74 +0,0 @@
# HG changeset patch
# User Lars T Hansen <lhansen@mozilla.com>
# Date 1519822672 -3600
# Wed Feb 28 13:57:52 2018 +0100
# Node ID 672f0415217b202ae59a930769dffd9d6ba6b87c
# Parent 825fd04dacc6297d3a980ec4184079405950b35d
Bug 1375074 - Save and restore non-volatile x28 on ARM64 for generated unboxed object constructor.
diff --git a/js/src/jit-test/tests/bug1375074.js b/js/src/jit-test/tests/bug1375074.js
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/bug1375074.js
@@ -0,0 +1,18 @@
+// This forces the VM to start creating unboxed objects and thus stresses a
+// particular path into generated code for a specialized unboxed object
+// constructor.
+
+var K = 2000; // 2000 should be plenty
+var s = "[";
+var i;
+for ( i=0; i < K-1; i++ )
+ s = s + `{"i":${i}},`;
+s += `{"i":${i}}]`;
+var v = JSON.parse(s);
+
+assertEq(v.length == K, true);
+
+for ( i=0; i < K; i++) {
+ assertEq(v[i] instanceof Object, true);
+ assertEq(v[i].i, i);
+}
diff --git a/js/src/vm/UnboxedObject.cpp b/js/src/vm/UnboxedObject.cpp
--- a/js/src/vm/UnboxedObject.cpp
+++ b/js/src/vm/UnboxedObject.cpp
@@ -95,7 +95,15 @@ UnboxedLayout::makeConstructorCode(JSCon
#endif
#ifdef JS_CODEGEN_ARM64
- // ARM64 communicates stack address via sp, but uses a pseudo-sp for addressing.
+ // ARM64 communicates stack address via sp, but uses a pseudo-sp (PSP) for
+ // addressing. The register we use for PSP may however also be used by
+ // calling code, and it is nonvolatile, so save it. Do this as a special
+ // case first because the generic save/restore code needs the PSP to be
+ // initialized already.
+ MOZ_ASSERT(PseudoStackPointer64.Is(masm.GetStackPointer64()));
+ masm.Str(PseudoStackPointer64, vixl::MemOperand(sp, -16, vixl::PreIndex));
+
+ // Initialize the PSP from the SP.
masm.initStackPtr();
#endif
@@ -233,7 +241,22 @@ UnboxedLayout::makeConstructorCode(JSCon
masm.pop(ScratchDoubleReg);
masm.PopRegsInMask(savedNonVolatileRegisters);
+#ifdef JS_CODEGEN_ARM64
+ // Now restore the value that was in the PSP register on entry, and return.
+
+ // Obtain the correct SP from the PSP.
+ masm.Mov(sp, PseudoStackPointer64);
+
+ // Restore the saved value of the PSP register, this value is whatever the
+ // caller had saved in it, not any actual SP value, and it must not be
+ // overwritten subsequently.
+ masm.Ldr(PseudoStackPointer64, vixl::MemOperand(sp, 16, vixl::PostIndex));
+
+ // Perform a plain Ret(), as abiret() will move SP <- PSP and that is wrong.
+ masm.Ret(vixl::lr);
+#else
masm.abiret();
+#endif
masm.bind(&failureStoreOther);

View File

@ -1,12 +0,0 @@
diff -up thunderbird-60.3.0/toolkit/components/remote/nsRemoteService.cpp.old thunderbird-60.3.0/toolkit/components/remote/nsRemoteService.cpp
--- thunderbird-60.3.0/toolkit/components/remote/nsRemoteService.cpp.old 2018-11-06 11:25:46.634929894 +0100
+++ thunderbird-60.3.0/toolkit/components/remote/nsRemoteService.cpp 2018-11-06 11:21:49.617828440 +0100
@@ -34,7 +34,7 @@ NS_IMPL_ISUPPORTS(nsRemoteService,
NS_IMETHODIMP
nsRemoteService::Startup(const char* aAppName, const char* aProfileName)
{
-#if defined(MOZ_ENABLE_DBUS)
+#if 0
nsresult rv;
mDBusRemoteService = new nsDBusRemoteService();
rv = mDBusRemoteService->Startup(aAppName, aProfileName);

View File

@ -1,26 +0,0 @@
diff -up firefox-44.0/nsprpub/config/make-system-wrappers.pl.back firefox-44.0/nsprpub/config/make-system-wrappers.pl
--- firefox-44.0/nsprpub/config/make-system-wrappers.pl.back 2016-01-24 00:23:49.000000000 +0100
+++ firefox-44.0/nsprpub/config/make-system-wrappers.pl 2016-02-02 14:58:45.064112655 +0100
@@ -19,7 +19,9 @@ while (<STDIN>) {
open OUT, ">$output_dir/$_";
print OUT "#pragma GCC system_header\n"; # suppress include_next warning
print OUT "#pragma GCC visibility push(default)\n";
+ print OUT "#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS\n";
print OUT "#include_next \<$_\>\n";
+ print OUT "#undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS\n";
print OUT "#pragma GCC visibility pop\n";
close OUT;
}
diff -up firefox-44.0/mozglue/build/arm.cpp.old firefox-44.0/mozglue/build/arm.cpp
--- firefox-44.0/mozglue/build/arm.cpp.old 2016-02-03 10:07:29.879526500 +0100
+++ firefox-44.0/mozglue/build/arm.cpp 2016-02-03 10:08:11.062697517 +0100
@@ -104,7 +104,9 @@ check_neon(void)
# elif defined(__linux__) || defined(ANDROID)
# include <stdio.h>
+#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS
# include <stdlib.h>
+#undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS
# include <string.h>
enum{

View File

@ -1,94 +0,0 @@
diff -up firefox-63.0.3/widget/gtk/mozcontainer.cpp.mozbz1507475 firefox-63.0.3/widget/gtk/mozcontainer.cpp
--- firefox-63.0.3/widget/gtk/mozcontainer.cpp.mozbz1507475 2018-11-15 01:20:56.000000000 +0100
+++ firefox-63.0.3/widget/gtk/mozcontainer.cpp 2018-11-21 15:41:41.858692640 +0100
@@ -169,6 +169,8 @@ moz_container_class_init (MozContainerCl
}
#if defined(MOZ_WAYLAND)
+static struct wl_subcompositor *subcompositor;
+
static void
registry_handle_global (void *data,
struct wl_registry *registry,
@@ -176,9 +178,8 @@ registry_handle_global (void *data,
const char *interface,
uint32_t version)
{
- MozContainer *container = MOZ_CONTAINER(data);
if(strcmp(interface, "wl_subcompositor") == 0) {
- container->subcompositor =
+ subcompositor =
static_cast<wl_subcompositor*>(wl_registry_bind(registry,
name,
&wl_subcompositor_interface,
@@ -197,6 +198,24 @@ static const struct wl_registry_listener
registry_handle_global,
registry_handle_global_remove
};
+
+struct wl_subcompositor* subcompositor_get(void)
+{
+ if (!subcompositor) {
+ GdkDisplay *gdk_display = gdk_display_get_default();
+ // Available as of GTK 3.8+
+ static auto sGdkWaylandDisplayGetWlDisplay =
+ (wl_display *(*)(GdkDisplay *))
+ dlsym(RTLD_DEFAULT, "gdk_wayland_display_get_wl_display");
+
+ wl_display* display = sGdkWaylandDisplayGetWlDisplay(gdk_display);
+ wl_registry* registry = wl_display_get_registry(display);
+ wl_registry_add_listener(registry, &registry_listener, nullptr);
+ wl_display_dispatch(display);
+ wl_display_roundtrip(display);
+ }
+ return subcompositor;
+}
#endif
void
@@ -208,25 +227,10 @@ moz_container_init (MozContainer *contai
#if defined(MOZ_WAYLAND)
{
- container->subcompositor = nullptr;
container->surface = nullptr;
container->subsurface = nullptr;
container->eglwindow = nullptr;
container->parent_surface_committed = false;
-
- GdkDisplay *gdk_display = gtk_widget_get_display(GTK_WIDGET(container));
- if (GDK_IS_WAYLAND_DISPLAY (gdk_display)) {
- // Available as of GTK 3.8+
- static auto sGdkWaylandDisplayGetWlDisplay =
- (wl_display *(*)(GdkDisplay *))
- dlsym(RTLD_DEFAULT, "gdk_wayland_display_get_wl_display");
-
- wl_display* display = sGdkWaylandDisplayGetWlDisplay(gdk_display);
- wl_registry* registry = wl_display_get_registry(display);
- wl_registry_add_listener(registry, &registry_listener, container);
- wl_display_dispatch(display);
- wl_display_roundtrip(display);
- }
}
#endif
}
@@ -298,7 +302,7 @@ moz_container_map_surface(MozContainer *
}
container->subsurface =
- wl_subcompositor_get_subsurface (container->subcompositor,
+ wl_subcompositor_get_subsurface (subcompositor_get(),
container->surface,
gtk_surface);
gint x, y;
diff -up firefox-63.0.3/widget/gtk/mozcontainer.h.mozbz1507475 firefox-63.0.3/widget/gtk/mozcontainer.h
--- firefox-63.0.3/widget/gtk/mozcontainer.h.mozbz1507475 2018-11-15 01:20:56.000000000 +0100
+++ firefox-63.0.3/widget/gtk/mozcontainer.h 2018-11-21 14:16:54.412397805 +0100
@@ -69,7 +69,6 @@ struct _MozContainer
GList *children;
#ifdef MOZ_WAYLAND
- struct wl_subcompositor *subcompositor;
struct wl_surface *surface;
struct wl_subsurface *subsurface;
struct wl_egl_window *eglwindow;

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +0,0 @@
diff --git a/widget/xremoteclient/DBusRemoteClient.cpp b/widget/xremoteclient/DBusRemoteClient.cpp
--- a/widget/xremoteclient/DBusRemoteClient.cpp
+++ b/widget/xremoteclient/DBusRemoteClient.cpp
@@ -13,6 +13,7 @@
#include "nsPrintfCString.h"
#include <dlfcn.h>
+#include <dbus/dbus-glib-lowlevel.h>
using mozilla::LogLevel;
static mozilla::LazyLogModule sRemoteLm("DBusRemoteClient");

View File

@ -109,11 +109,9 @@ Patch37: build-jit-atomic-always-lucky.patch
Patch40: build-aarch64-skia.patch
Patch226: rhbz-1354671.patch
Patch415: Bug-1238661---fix-mozillaSignalTrampoline-to-work-.patch
#Patch417: bug1375074-save-restore-x28.patch
# Build patches
Patch103: rhbz-1219542-s390-build.patch
#Patch104: firefox-gcc-6.0.patch
# PPC fix
Patch304: mozilla-1245783.patch
@ -121,12 +119,9 @@ Patch305: build-big-endian.patch
Patch306: mozilla-1353817.patch
Patch307: build-disable-elfhack.patch
Patch309: mozilla-1460871-ldap-query.patch
#Patch314: mozbz-1500850-missing-dbus-header.patch
# Fedora specific patches
#Patch310: disable-dbus-remote.patch
Patch311: firefox-wayland.patch
Patch313: firefox-wayland-crash-mozbz1507475.patch
# Upstream patches
@ -235,17 +230,14 @@ debug %{name}, you want to install %{name}-debuginfo instead.
%ifarch s390
%patch103 -p1 -b .rhbz-1219542-s390-build
%endif
#%patch104 -p1 -b .gcc6
%patch304 -p1 -b .1245783
%patch309 -p1 -b .1460871-ldap-query
#%patch314 -p1 -b .1500850-missing-dbus-header
# Patch for big endian platforms only
%if 0%{?big_endian}
%patch26 -p1 -b .icu
%patch305 -p1 -b .big-endian
%endif
#%patch310 -p1 -b .disable-dbus-remote
%patch37 -p1 -b .jit-atomic-lucky
%patch40 -p1 -b .aarch64-skia
@ -256,7 +248,6 @@ debug %{name}, you want to install %{name}-debuginfo instead.
%ifarch %{arm}
%patch415 -p1 -b .mozilla-1238661
%endif
#%patch417 -p1 -b .bug1375074-save-restore-x28
%patch306 -p1 -b .1353817
%if 0%{?disable_elfhack}
@ -264,9 +255,7 @@ debug %{name}, you want to install %{name}-debuginfo instead.
%endif
#cd ..
#TODO - needs fixes
#%patch311 -p1 -b .wayland
#%patch313 -p1 -b .mozbz1507475
%patch311 -p1 -b .wayland
%if %{official_branding}
# Required by Mozilla Corporation