Merge remote-tracking branch 'origin/tracking' into custom

This commit is contained in:
2022-06-13 09:12:00 +08:00
32 changed files with 241 additions and 260 deletions
Vendored
-1
View File
@@ -25,7 +25,6 @@ builtin(include, build/autoconf/zlib.m4)dnl
builtin(include, build/autoconf/icu.m4)dnl
builtin(include, build/autoconf/clang-plugin.m4)dnl
builtin(include, build/autoconf/alloc.m4)dnl
builtin(include, build/autoconf/ios.m4)dnl
builtin(include, build/autoconf/sanitize.m4)dnl
MOZ_PROG_CHECKMSYS()
-108
View File
@@ -1,108 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
AC_DEFUN([MOZ_IOS_PATH_PROG],
[
changequote({,})
_prog_name=ifelse($2, {}, `echo $1 | tr "[:upper:]" "[:lower:]"`, $2)
changequote([,])
AC_CACHE_CHECK([for $_prog_name in iOS SDK],
ac_cv_ios_path_$1,
[
_path=`xcrun --sdk $ios_sdk --find $_prog_name 2>/dev/null`
_res=$?
if test $_res -ne 0; then
AC_MSG_ERROR([Could not find '$_prog_name' in the iOS SDK])
fi
ac_cv_ios_path_$1=$_path
])
$1="${ac_cv_ios_path_$1}$3"
])
AC_DEFUN([MOZ_IOS_SDK],
[
MOZ_ARG_WITH_STRING(ios-sdk,
[ --with-ios-sdk=TYPE
Type of iOS SDK to use (iphonesimulator, iphoneos)
and optionally version (like iphoneos8.2)],
ios_sdk=$withval)
MOZ_ARG_ENABLE_STRING(ios-target,
[ --enable-ios-target=VER (default=8.0)
Set the minimum iOS version needed at runtime],
[_IOS_TARGET=$enableval])
_IOS_TARGET_DEFAULT=8.0
case "$target" in
arm*-apple-darwin*)
if test -z "$ios_sdk" -o "$ios_sdk" = "yes"; then
ios_sdk=iphoneos
fi
case "$ios_sdk" in
iphoneos*)
ios_target_arg="-miphoneos-version-min"
;;
*)
AC_MSG_ERROR([Only 'iphoneos' SDKs are valid when targeting iOS device, don't know what to do with '$ios_sdk'.])
;;
esac
;;
*-apple-darwin*)
ios_target_arg="-mios-simulator-version-min"
case "$ios_sdk" in
# Empty SDK is okay, this might be an OS X desktop build.
""|iphonesimulator*)
;;
# Default to iphonesimulator
yes)
ios_sdk=iphonesimulator
;;
*)
AC_MSG_ERROR([Only 'iphonesimulator' SDKs are valid when targeting iOS simulator.])
;;
esac
;;
esac
if test -n "$ios_sdk"; then
if test -z "$_IOS_TARGET"; then
_IOS_TARGET=$_IOS_TARGET_DEFAULT
ios_target_arg="${ios_target_arg}=${_IOS_TARGET}"
fi
# Ensure that xcrun knows where this SDK is.
ios_sdk_path=`xcrun --sdk $ios_sdk --show-sdk-path 2>/dev/null`
_ret=$?
if test $_ret -ne 0; then
AC_MSG_ERROR([iOS SDK '$ios_sdk' could not be found.])
fi
MOZ_IOS=1
export HOST_CC=clang
export HOST_CXX=clang++
# Add isysroot, arch, and ios target arguments
case "$target_cpu" in
arm*)
ARGS="-arch armv7"
;;
*)
# Unfortunately simulator builds need this.
export CROSS_COMPILE=1
;;
esac
ARGS=" $ARGS -isysroot $ios_sdk_path $ios_target_arg"
# Now find our tools
MOZ_IOS_PATH_PROG(CC, clang, $ARGS)
MOZ_IOS_PATH_PROG(CXX, clang++, $ARGS)
export CPP="$CC -E"
export LD="$CXX"
MOZ_IOS_PATH_PROG(AR)
MOZ_IOS_PATH_PROG(AS, as, $ARGS)
MOZ_IOS_PATH_PROG(OTOOL)
MOZ_IOS_PATH_PROG(STRIP)
export PKG_CONFIG_PATH=${ios_sdk_path}/usr/lib/pkgconfig/
fi
AC_SUBST(MOZ_IOS)
])
+3
View File
@@ -27,6 +27,9 @@ fi
if test "`echo | $AS -o conftest.out -v 2>&1 | grep -c GNU`" != "0"; then
GNU_AS=1
fi
if test "`echo | $AS -o conftest.out -v 2>&1 | grep -c LLVM`" != "0"; then
GNU_AS=1
fi
rm -f conftest.out
if test "`echo | $LD -v 2>&1 | grep -c GNU`" != "0"; then
GNU_LD=1
-7
View File
@@ -324,9 +324,6 @@ def split_triplet(triplet):
elif os.startswith('darwin'):
canonical_kernel = 'Darwin'
canonical_os = 'OSX'
elif os.startswith('ios'):
canonical_kernel = 'Darwin'
canonical_os = 'iOS'
elif os.startswith('dragonfly'):
canonical_os = canonical_kernel = 'DragonFly'
elif os.startswith('freebsd'):
@@ -458,10 +455,6 @@ add_old_configure_arg(host_for_old_configure)
@depends(host, target)
def target_for_old_configure(host, target):
target_alias = target.alias
# old-configure does plenty of tests against $target and $target_os
# and expects darwin for iOS, so make it happy.
if target.os == 'iOS':
target_alias = target_alias.replace('-ios', '-darwin')
return '--target=%s' % target_alias
add_old_configure_arg(target_for_old_configure)
+2
View File
@@ -121,6 +121,8 @@ else:
DEFINES['SYMBOL_UNDERSCORE'] = True
else:
ffi_srcs = ('ffi.c', 'darwin.S', 'ffi64.c', 'darwin64.S')
elif CONFIG['FFI_TARGET'] == 'AARCH64_DARWIN':
ffi_srcs = ('sysv.S', 'ffi.c')
SOURCES += [
'/js/src/ctypes/libffi/src/%s/%s' % (CONFIG['FFI_TARGET_DIR'], s)
@@ -9519,6 +9519,7 @@ exports.CSS_PROPERTIES = {
"supports": [],
"values": [
"-moz-pre-space",
"break-spaces",
"inherit",
"initial",
"normal",
+13 -3
View File
@@ -851,6 +851,7 @@ gfxTextRun::BreakAndMeasureText(uint32_t aStart, uint32_t aMaxLength,
bool *aUsedHyphenation,
uint32_t *aLastBreak,
bool aCanWordWrap,
bool aCanWhitespaceWrap,
gfxBreakPriority *aBreakPriority)
{
aMaxLength = std::min(aMaxLength, GetLength() - aStart);
@@ -918,7 +919,15 @@ gfxTextRun::BreakAndMeasureText(uint32_t aStart, uint32_t aMaxLength,
aCanWordWrap && mCharacterGlyphs[i].IsClusterStart() &&
*aBreakPriority <= gfxBreakPriority::eWordWrapBreak;
if (atBreak || wordWrapping) {
bool whitespaceWrapping = false;
if (i > aStart) {
// The spec says the breaking opportunity is *after* whitespace.
auto const& g = mCharacterGlyphs[i - 1];
whitespaceWrapping = aCanWhitespaceWrap &&
(g.CharIsSpace() || g.CharIsTab() || g.CharIsNewline());
}
if (atBreak || wordWrapping || whitespaceWrapping) {
gfxFloat hyphenatedAdvance = advance;
if (atHyphenationBreak) {
hyphenatedAdvance += aProvider->GetHyphenWidth();
@@ -930,8 +939,9 @@ gfxTextRun::BreakAndMeasureText(uint32_t aStart, uint32_t aMaxLength,
lastBreakTrimmableChars = trimmableChars;
lastBreakTrimmableAdvance = trimmableAdvance;
lastBreakUsedHyphenation = atHyphenationBreak;
*aBreakPriority = atBreak ? gfxBreakPriority::eNormalBreak
: gfxBreakPriority::eWordWrapBreak;
*aBreakPriority = (atBreak || whitespaceWrapping)
? gfxBreakPriority::eNormalBreak
: gfxBreakPriority::eWordWrapBreak;
}
width += advance;
+1
View File
@@ -409,6 +409,7 @@ public:
bool *aUsedHyphenation,
uint32_t *aLastBreak,
bool aCanWordWrap,
bool aCanWhitespaceWrap,
gfxBreakPriority *aBreakPriority);
// Utility getters
+1 -1
View File
@@ -135,7 +135,7 @@ Atomic64 Release_Load(volatile const Atomic64* ptr);
// Include our platform specific implementation.
#if defined(OS_WIN) && defined(ARCH_CPU_X86_FAMILY)
#include "base/atomicops_internals_x86_msvc.h"
#elif defined(OS_MACOSX) && defined(ARCH_CPU_X86_FAMILY)
#elif defined(OS_MACOSX) && (defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM64))
#include "base/atomicops_internals_x86_macosx.h"
#elif defined(COMPILER_GCC) && defined(ARCH_CPU_X86_FAMILY)
#include "base/atomicops_internals_x86_gcc.h"
+6 -2
View File
@@ -38,8 +38,12 @@ def ffi_target(target):
else:
target_name = 'X86_WIN32'
elif target.os == 'OSX':
target_dir = 'x86'
target_name = 'X86_DARWIN'
if target.cpu == 'aarch64':
target_name = 'AARCH64_DARWIN'
target_dir = 'aarch64'
else:
target_name = 'X86_DARWIN'
target_dir = 'x86'
elif target.cpu == 'arm':
target_dir = 'arm'
target_name = 'ARM'
-1
View File
@@ -25,7 +25,6 @@ builtin(include, ../../build/autoconf/icu.m4)dnl
builtin(include, ../../build/autoconf/clang-plugin.m4)dnl
builtin(include, ../../build/autoconf/alloc.m4)dnl
builtin(include, ../../build/autoconf/sanitize.m4)dnl
builtin(include, ../../build/autoconf/ios.m4)dnl
define([__MOZ_AC_INIT_PREPARE], defn([AC_INIT_PREPARE]))
define([AC_INIT_PREPARE],
+12 -1
View File
@@ -370,6 +370,12 @@ struct macos_arm_context {
arm_neon_state_t float_;
};
# define EMULATOR_CONTEXT macos_arm_context
# elif defined(__aarch64__)
struct macos_aarch64_context {
arm_thread_state64_t thread;
arm_neon_state64_t float_;
};
# define EMULATOR_CONTEXT macos_aarch64_context
# else
# error Unsupported architecture
# endif
@@ -887,7 +893,7 @@ ContextToPC(EMULATOR_CONTEXT* context)
static_assert(sizeof(context->thread.uts.ts32.__eip) == sizeof(void*),
"stored IP should be compile-time pointer-sized");
return reinterpret_cast<uint8_t**>(&context->thread.uts.ts32.__eip);
# elif defined(JS_CPU_ARM)
# elif defined(JS_CPU_ARM) || defined(__aarch64__)
static_assert(sizeof(context->thread.__pc) == sizeof(void*),
"stored IP should be compile-time pointer-sized");
return reinterpret_cast<uint8_t**>(&context->thread.__pc);
@@ -948,6 +954,11 @@ HandleMachException(JSRuntime* rt, const ExceptionRequest& request)
unsigned int float_state_count = ARM_NEON_STATE_COUNT;
int thread_state = ARM_THREAD_STATE;
int float_state = ARM_NEON_STATE;
# elif defined(__aarch64__)
unsigned int thread_state_count = ARM_THREAD_STATE64_COUNT;
unsigned int float_state_count = ARM_NEON_STATE64_COUNT;
int thread_state = ARM_THREAD_STATE64;
int float_state = ARM_NEON_STATE64;
# else
# error Unsupported architecture
# endif
+26 -26
View File
@@ -1988,35 +1988,31 @@ GetHyphenTextRun(const gfxTextRun* aTextRun, DrawTarget* aDrawTarget,
MakeHyphenTextRun(dt, aTextRun->GetAppUnitsPerDevUnit());
}
static_assert(NS_STYLE_WHITESPACE_NORMAL == 0, "Convention: NS_STYLE_WHITESPACE_NORMAL should be 0");
static_assert(NS_STYLE_WHITESPACE_PRE == 1, "Convention: NS_STYLE_WHITESPACE_PRE should be 1");
static_assert(NS_STYLE_WHITESPACE_NOWRAP == 2, "Convention: NS_STYLE_WHITESPACE_NOWRAP should be 2");
static_assert(NS_STYLE_WHITESPACE_PRE_WRAP == 3, "Convention: NS_STYLE_WHITESPACE_PRE_WRAP should be 3");
static_assert(NS_STYLE_WHITESPACE_PRE_LINE == 4, "Convention: NS_STYLE_WHITESPACE_PRE_LINE should be 4");
static_assert(NS_STYLE_WHITESPACE_PRE_SPACE == 5, "Convention: NS_STYLE_WHITESPACE_PRE_SPACE should be 5");
static nsTextFrameUtils::CompressionMode
GetCSSWhitespaceToCompressionMode(nsTextFrame* aFrame,
const nsStyleText* aStyleText)
{
static const nsTextFrameUtils::CompressionMode sModes[] =
{
nsTextFrameUtils::COMPRESS_WHITESPACE_NEWLINE, // normal
nsTextFrameUtils::COMPRESS_NONE, // pre
nsTextFrameUtils::COMPRESS_WHITESPACE_NEWLINE, // nowrap
nsTextFrameUtils::COMPRESS_NONE, // pre-wrap
nsTextFrameUtils::COMPRESS_WHITESPACE, // pre-line
nsTextFrameUtils::COMPRESS_NONE_TRANSFORM_TO_SPACE // -moz-pre-space
};
auto compression = sModes[aStyleText->mWhiteSpace];
if (compression == nsTextFrameUtils::COMPRESS_NONE &&
!aStyleText->NewlineIsSignificant(aFrame)) {
// If newline is set to be preserved, but then suppressed,
// transform newline to space.
compression = nsTextFrameUtils::COMPRESS_NONE_TRANSFORM_TO_SPACE;
switch (aStyleText->mWhiteSpace) {
case NS_STYLE_WHITESPACE_NORMAL:
case NS_STYLE_WHITESPACE_NOWRAP:
return nsTextFrameUtils::COMPRESS_WHITESPACE_NEWLINE;
case NS_STYLE_WHITESPACE_PRE:
case NS_STYLE_WHITESPACE_PRE_WRAP:
case NS_STYLE_WHITESPACE_BREAK_SPACES:
if (!aStyleText->NewlineIsSignificant(aFrame)) {
// If newline is set to be preserved, but then suppressed,
// transform newline to space.
return nsTextFrameUtils::COMPRESS_NONE_TRANSFORM_TO_SPACE;
}
return nsTextFrameUtils::COMPRESS_NONE;
case NS_STYLE_WHITESPACE_PRE_SPACE:
return nsTextFrameUtils::COMPRESS_NONE_TRANSFORM_TO_SPACE;
case NS_STYLE_WHITESPACE_PRE_LINE:
return nsTextFrameUtils::COMPRESS_WHITESPACE;
default:
MOZ_ASSERT_UNREACHABLE("Unknown white-space value");
return nsTextFrameUtils::COMPRESS_WHITESPACE_NEWLINE;
}
return compression;
}
already_AddRefed<gfxTextRun>
@@ -9206,8 +9202,10 @@ nsTextFrame::ReflowText(nsLineLayout& aLineLayout, nscoord aAvailableWidth,
}
bool canTrimTrailingWhitespace = !textStyle->WhiteSpaceIsSignificant() ||
(GetStateBits() & TEXT_IS_IN_TOKEN_MATHML);
bool isBreakSpaces = textStyle->mWhiteSpace == NS_STYLE_WHITESPACE_BREAK_SPACES;
// allow whitespace to overflow the container
bool whitespaceCanHang = textStyle->WhiteSpaceCanWrapStyle() &&
bool whitespaceCanHang = !isBreakSpaces &&
textStyle->WhiteSpaceCanWrapStyle() &&
textStyle->WhiteSpaceIsSignificant();
gfxBreakPriority breakPriority = aLineLayout.LastOptionalBreakPriority();
gfxTextRun::SuppressBreak suppressBreak = gfxTextRun::eNoSuppressBreak;
@@ -9227,7 +9225,9 @@ nsTextFrame::ReflowText(nsLineLayout& aLineLayout, nscoord aAvailableWidth,
&textMetrics, boundingBoxType,
aDrawTarget,
&usedHyphenation, &transformedLastBreak,
textStyle->WordCanWrap(this), &breakPriority);
textStyle->WordCanWrap(this),
isBreakSpaces,
&breakPriority);
if (!length && !textMetrics.mAscent && !textMetrics.mDescent) {
// If we're measuring a zero-length piece of text, update
// the height manually.
+1
View File
@@ -171,6 +171,7 @@ CSS_KEY(both, both)
CSS_KEY(bottom, bottom)
CSS_KEY(bottom-outside, bottom_outside)
CSS_KEY(break-all, break_all)
CSS_KEY(break-spaces, break_spaces)
CSS_KEY(break-word, break_word)
CSS_KEY(brightness, brightness)
CSS_KEY(browser, browser)
+1
View File
@@ -2253,6 +2253,7 @@ const KTableEntry nsCSSProps::kWhitespaceKTable[] = {
{ eCSSKeyword_pre_wrap, NS_STYLE_WHITESPACE_PRE_WRAP },
{ eCSSKeyword_pre_line, NS_STYLE_WHITESPACE_PRE_LINE },
{ eCSSKeyword__moz_pre_space, NS_STYLE_WHITESPACE_PRE_SPACE },
{ eCSSKeyword_break_spaces, NS_STYLE_WHITESPACE_BREAK_SPACES },
{ eCSSKeyword_UNKNOWN, -1 }
};
+7 -6
View File
@@ -995,12 +995,13 @@ enum class StyleDisplay : uint8_t {
#define NS_STYLE_TABSIZE_INITIAL 8
// See nsStyleText
#define NS_STYLE_WHITESPACE_NORMAL 0
#define NS_STYLE_WHITESPACE_PRE 1
#define NS_STYLE_WHITESPACE_NOWRAP 2
#define NS_STYLE_WHITESPACE_PRE_WRAP 3
#define NS_STYLE_WHITESPACE_PRE_LINE 4
#define NS_STYLE_WHITESPACE_PRE_SPACE 5
#define NS_STYLE_WHITESPACE_NORMAL 0
#define NS_STYLE_WHITESPACE_PRE 1
#define NS_STYLE_WHITESPACE_NOWRAP 2
#define NS_STYLE_WHITESPACE_PRE_WRAP 3
#define NS_STYLE_WHITESPACE_PRE_LINE 4
#define NS_STYLE_WHITESPACE_PRE_SPACE 5
#define NS_STYLE_WHITESPACE_BREAK_SPACES 6
// See nsStyleText
#define NS_STYLE_WORDBREAK_NORMAL 0
+6 -1
View File
@@ -2105,30 +2105,35 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleText
bool WhiteSpaceIsSignificant() const {
return mWhiteSpace == NS_STYLE_WHITESPACE_PRE ||
mWhiteSpace == NS_STYLE_WHITESPACE_PRE_WRAP ||
mWhiteSpace == NS_STYLE_WHITESPACE_BREAK_SPACES ||
mWhiteSpace == NS_STYLE_WHITESPACE_PRE_SPACE;
}
bool NewlineIsSignificantStyle() const {
return mWhiteSpace == NS_STYLE_WHITESPACE_PRE ||
mWhiteSpace == NS_STYLE_WHITESPACE_PRE_WRAP ||
mWhiteSpace == NS_STYLE_WHITESPACE_BREAK_SPACES ||
mWhiteSpace == NS_STYLE_WHITESPACE_PRE_LINE;
}
bool WhiteSpaceOrNewlineIsSignificant() const {
return mWhiteSpace == NS_STYLE_WHITESPACE_PRE ||
mWhiteSpace == NS_STYLE_WHITESPACE_PRE_WRAP ||
mWhiteSpace == NS_STYLE_WHITESPACE_BREAK_SPACES ||
mWhiteSpace == NS_STYLE_WHITESPACE_PRE_LINE ||
mWhiteSpace == NS_STYLE_WHITESPACE_PRE_SPACE;
}
bool TabIsSignificant() const {
return mWhiteSpace == NS_STYLE_WHITESPACE_PRE ||
mWhiteSpace == NS_STYLE_WHITESPACE_PRE_WRAP;
mWhiteSpace == NS_STYLE_WHITESPACE_PRE_WRAP ||
mWhiteSpace == NS_STYLE_WHITESPACE_BREAK_SPACES;
}
bool WhiteSpaceCanWrapStyle() const {
return mWhiteSpace == NS_STYLE_WHITESPACE_NORMAL ||
mWhiteSpace == NS_STYLE_WHITESPACE_PRE_WRAP ||
mWhiteSpace == NS_STYLE_WHITESPACE_BREAK_SPACES ||
mWhiteSpace == NS_STYLE_WHITESPACE_PRE_LINE;
}
+1 -1
View File
@@ -4052,7 +4052,7 @@ var gCSSProperties = {
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "normal" ],
other_values: [ "pre", "nowrap", "pre-wrap", "pre-line", "-moz-pre-space" ],
other_values: [ "pre", "nowrap", "pre-wrap", "pre-line", "-moz-pre-space", "break-spaces" ],
invalid_values: []
},
"width": {
+1 -1
View File
@@ -40,7 +40,7 @@
#undef HAVE_STACK_GROWING_UP
#define HAVE_DLL
#if defined(__x86_64__) || TARGET_OS_IPHONE
#if defined(__x86_64__) || defined(__aarch64__)
#define USE_DLFCN
#else
#define USE_MACH_DYLD
+7 -44
View File
@@ -96,12 +96,6 @@ case "$target" in
;;
esac
case "$target" in
*-apple-darwin*)
MOZ_IOS_SDK
;;
esac
AC_SUBST(ANDROID_SOURCE)
AC_SUBST(ANDROID_PACKAGE_NAME)
AC_SUBST(OBJCOPY)
@@ -787,27 +781,11 @@ case "$target" in
DLL_SUFFIX=".dylib"
DSO_LDOPTS=''
STRIP_FLAGS="$STRIP_FLAGS -x -S"
# Ensure that if we're targeting iOS an SDK was provided.
AC_CACHE_CHECK(for iOS target,
ac_cv_ios_target,
[AC_TRY_COMPILE([#include <TargetConditionals.h>
#if !(TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
#error not iOS
#endif],
[],
ac_cv_ios_target="yes",
ac_cv_ios_target="no")])
if test "$ac_cv_ios_target" = "yes" -a -z $MOZ_IOS; then
AC_MSG_ERROR([targeting iOS but not using an iOS SDK?])
fi
if test -n "$MOZ_IOS"; then
direct_nspr_config=1
else
# The ExceptionHandling framework is needed for Objective-C exception
# logging code in nsObjCExceptions.h. Currently we only use that in debug
# builds.
MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling";
fi
# The ExceptionHandling framework is needed for Objective-C exception
# logging code in nsObjCExceptions.h. Currently we only use that in debug
# builds.
MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling";
if test "x$lto_is_enabled" = "xyes"; then
echo "Skipping -dead_strip because lto is enabled."
@@ -2084,9 +2062,6 @@ MOZ_OFFICIAL_BRANDING=
MC_OFFICIAL=
MOZ_FEEDS=1
MOZ_AUTH_EXTENSION=1
if test "$MOZ_IOS"; then
MOZ_AUTH_EXTENSION=
fi
MOZ_RAW=
MOZ_AV1=
MOZ_VORBIS=
@@ -3103,10 +3078,6 @@ MOZ_ARG_DISABLE_BOOL(negotiateauth,
MOZ_AUTH_EXTENSION=,
MOZ_AUTH_EXTENSION=1 )
if test -n "$MOZ_IOS" -a -n "$MOZ_AUTH_EXTENSION"; then
AC_MSG_ERROR([negotiateauth is not supported on iOS.])
fi
dnl ========================================================
dnl Pref extensions (autoconfig)
dnl ========================================================
@@ -3337,9 +3308,7 @@ MOZ_ARG_ENABLE_BOOL(gamepad,
if test "$MOZ_GAMEPAD"; then
case "$OS_TARGET" in
Darwin)
if test -z "$MOZ_IOS"; then
MOZ_GAMEPAD_BACKEND=cocoa
fi
MOZ_GAMEPAD_BACKEND=cocoa
;;
WINNT)
MOZ_GAMEPAD_BACKEND=windows
@@ -3656,10 +3625,6 @@ dnl ========================================================
dnl Updater
dnl ========================================================
if test "$MOZ_IOS"; then
MOZ_UPDATER=
fi
MOZ_ARG_ENABLE_BOOL(updater,
[ --enable-updater Enable building of internal updater],
MOZ_UPDATER=1,
@@ -4863,9 +4828,7 @@ MOZ_ARG_DISABLE_BOOL(necko-wifi,
if test "$MOZ_NECKO_WIFI"; then
case "$OS_TARGET" in
Darwin)
if test -z "$MOZ_IOS"; then
NECKO_WIFI=1
fi
NECKO_WIFI=1
;;
DragonFly|FreeBSD|WINNT)
NECKO_WIFI=1
+3
View File
@@ -1345,6 +1345,9 @@ def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear, sy
"have Apple's development tools installed")
raise
# Resign the executable, since install_name_tool invalidates the signature
call_subprocess(["codesign", "-s", "-", py_executable])
if not is_win:
# Ensure that 'python', 'pythonX' and 'pythonX.Y' all exist
py_exe_version_major = 'python%s' % sys.version_info[0]
@@ -611,6 +611,14 @@ function UpdateParser(aId, aUpdateKey, aUrl, aObserver) {
let requireBuiltIn = Services.prefs.getBoolPref(PREF_UPDATE_REQUIREBUILTINCERTS, true);
logger.debug("Requesting " + aUrl);
if (!aUrl) {
logger.warn("Request failed: empty update manifest URL");
this._doneAt = new Error("UP_emptyManifestURL");
this.notifyError(AddonUpdateChecker.ERROR_DOWNLOAD_ERROR);
return;
}
try {
this.request = new ServiceRequest();
this.request.open("GET", this.url, true);
@@ -6134,6 +6134,15 @@ function UpdateChecker(aAddon, aListener, aReason, aAppVersion, aPlatformVersion
aReason |= UPDATE_TYPE_COMPATIBILITY;
if ("onUpdateAvailable" in this.listener)
aReason |= UPDATE_TYPE_NEWVERSION;
// Pass an empty string as the url and call checkForUpdates now if
// updateURL is empty. UpdateParser should detect this and fail early.
if (!updateURL) {
this._parser = AddonUpdateChecker.checkForUpdates(aAddon.id, aAddon.updateKey,
"", this);
return;
}
let url = escapeAddonURI(aAddon, updateURL, aReason, aAppVersion);
this._parser = AddonUpdateChecker.checkForUpdates(aAddon.id, aAddon.updateKey,
-1
View File
@@ -224,7 +224,6 @@ class WidgetRenderingContext;
enter:(BOOL)aEnter
exitFrom:(mozilla::WidgetMouseEvent::ExitFrom)aExitFrom;
- (void)updateGLContext;
- (void)_surfaceNeedsUpdate:(NSNotification*)notification;
- (bool)preRender:(NSOpenGLContext *)aGLContext;
+8 -12
View File
@@ -3309,16 +3309,11 @@ NSEvent* gLastDragMouseDownEvent = nil;
if (!mGLContext) {
mGLContext = aGLContext;
[mGLContext retain];
mNeedsGLUpdate = true;
mNeedsGLUpdate = YES;
}
CGLLockContext((CGLContextObj)[aGLContext CGLContextObj]);
if (mNeedsGLUpdate) {
[self updateGLContext];
mNeedsGLUpdate = NO;
}
return true;
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(false);
@@ -3472,12 +3467,6 @@ NSEvent* gLastDragMouseDownEvent = nil;
return YES;
}
-(void)updateGLContext
{
[mGLContext setView:mPixelHostingView];
[mGLContext update];
}
- (void)_surfaceNeedsUpdate:(NSNotification*)notification
{
if (mGLContext) {
@@ -3592,6 +3581,13 @@ NSEvent* gLastDragMouseDownEvent = nil;
LayoutDeviceIntRegion region(geckoBounds);
mGeckoChild->PaintWindow(region);
if (mNeedsGLUpdate) {
[mGLContext setView:mPixelHostingView];
[mGLContext update];
mNeedsGLUpdate = NO;
}
return;
}
+3 -2
View File
@@ -37,8 +37,9 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
'PoisonIOInterposerBase.cpp',
'PoisonIOInterposerMac.cpp',
]
SOURCES += ['mach_override.c']
SOURCES['mach_override.c'].flags += ['-Wno-unused-function']
if CONFIG["CPU_ARCH"] != "aarch64":
SOURCES += ['mach_override.c']
SOURCES['mach_override.c'].flags += ['-Wno-unused-function']
else:
SOURCES += ['PoisonIOInterposerStub.cpp']
+2
View File
@@ -281,6 +281,8 @@ static const uint32_t CPU_TYPE = CPU_TYPE_X86_64;
static const uint32_t CPU_TYPE = CPU_TYPE_POWERPC;
#elif defined(__ppc64__)
static const uint32_t CPU_TYPE = CPU_TYPE_POWERPC64;
#elif defined(__aarch64__)
static const uint32_t CPU_TYPE = CPU_TYPE_ARM64;
#else
#error Unsupported CPU type
#endif
+7 -2
View File
@@ -17,6 +17,11 @@ if CONFIG['OS_ARCH'] == 'Darwin':
SOURCES += [
'xptcinvoke_asm_x86_64_unix.S',
]
if CONFIG["CPU_ARCH"] == "aarch64":
SOURCES += [
"xptcinvoke_asm_aarch64.S",
"xptcstubs_asm_aarch64.S",
]
if '86' in CONFIG['OS_TEST'] and CONFIG['OS_TEST'] != 'x86_64':
DEFINES['MOZ_NEED_LEADING_UNDERSCORE'] = True
@@ -105,9 +110,9 @@ if CONFIG['OS_ARCH'] in ('Linux', 'FreeBSD', 'NetBSD', 'OpenBSD'):
if CONFIG['OS_TEST'] == 'aarch64':
SOURCES += [
'xptcinvoke_aarch64.cpp',
'xptcinvoke_asm_aarch64.s',
'xptcinvoke_asm_aarch64.S',
'xptcstubs_aarch64.cpp',
'xptcstubs_asm_aarch64.s',
'xptcstubs_asm_aarch64.S',
]
if CONFIG['OS_TEST'] == 'm68k':
SOURCES += [
@@ -3,20 +3,36 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
.section ".text"
.globl _NS_InvokeByIndex
#ifdef __APPLE__
#define SYM(x) _ ## x
#else
#define SYM(x) x
#endif
.text
.align 2
.globl SYM(_NS_InvokeByIndex)
#ifndef __APPLE__
.type _NS_InvokeByIndex,@function
#endif
/*
* _NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
* uint32_t paramCount, nsXPTCVariant* params)
*/
_NS_InvokeByIndex:
SYM(_NS_InvokeByIndex):
.cfi_startproc
# set up frame
stp x29, x30, [sp,#-32]!
.cfi_adjust_cfa_offset 32
.cfi_rel_offset x29, 0
.cfi_rel_offset x30, 8
mov x29, sp
.cfi_def_cfa_register x29
stp x19, x20, [sp,#16]
.cfi_rel_offset x19, 16
.cfi_rel_offset x20, 24
# save methodIndex across function calls
mov w20, w1
@@ -37,7 +53,7 @@ _NS_InvokeByIndex:
# start of stack area passed to invoke_copy_to_stack
mov x0, sp
bl invoke_copy_to_stack
bl SYM(invoke_copy_to_stack)
# load arguments passed in r0-r7
ldp x6, x7, [sp, #48]
@@ -58,10 +74,19 @@ _NS_InvokeByIndex:
blr x16
add sp, sp, w19, uxth #3
.cfi_def_cfa_register sp
ldp x19, x20, [sp,#16]
.cfi_restore x19
.cfi_restore x20
ldp x29, x30, [sp],#32
.cfi_adjust_cfa_offset -32
.cfi_restore x29
.cfi_restore x30
ret
.cfi_endproc
#ifndef __APPLE__
.size _NS_InvokeByIndex, . - _NS_InvokeByIndex
.section .note.GNU-stack, "", @progbits
#endif
@@ -10,6 +10,19 @@
#error "Only little endian compatibility was tested"
#endif
template<typename T> void
get_value_and_advance(T* aOutValue, void*& aStack) {
#ifdef __APPLE__
const size_t aligned_size = sizeof(T);
#else
const size_t aligned_size = 8;
#endif
// Ensure the pointer is aligned for the type
uintptr_t addr = (reinterpret_cast<uintptr_t>(aStack) + aligned_size - 1) & ~(aligned_size - 1);
memcpy(aOutValue, reinterpret_cast<void*>(addr), sizeof(T));
aStack = reinterpret_cast<void*>(addr + aligned_size);
}
/*
* This is for AArch64 ABI
*
@@ -17,8 +30,8 @@
* the "fp" registers are stored in fprData. Each array has 8 regs
* but first reg in gprData is a placeholder for 'self'.
*/
extern "C" nsresult
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
extern "C" nsresult ATTRIBUTE_USED
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, void* args,
uint64_t *gprData, double *fprData)
{
#define PARAM_BUFFER_COUNT 16
@@ -28,7 +41,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
const nsXPTMethodInfo* info;
nsresult result = NS_ERROR_FAILURE;
NS_ASSERTION(self,"no self");
@@ -45,7 +57,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
}
NS_ASSERTION(dispatchParams,"no place for params");
uint64_t* ap = args;
void* ap = args;
uint32_t next_gpr = 1; // skip first arg which is 'self'
uint32_t next_fpr = 0;
for (uint32_t i = 0; i < paramCount; i++) {
@@ -57,7 +69,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
if (next_gpr < PARAM_GPR_COUNT) {
dp->val.p = (void*)gprData[next_gpr++];
} else {
dp->val.p = (void*)*ap++;
get_value_and_advance(&dp->val.p, ap);
}
continue;
}
@@ -67,7 +79,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
if (next_gpr < PARAM_GPR_COUNT) {
dp->val.i8 = (int8_t)gprData[next_gpr++];
} else {
dp->val.i8 = (int8_t)*ap++;
get_value_and_advance(&dp->val.i8, ap);
}
break;
@@ -75,7 +87,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
if (next_gpr < PARAM_GPR_COUNT) {
dp->val.i16 = (int16_t)gprData[next_gpr++];
} else {
dp->val.i16 = (int16_t)*ap++;
get_value_and_advance(&dp->val.i16, ap);
}
break;
@@ -83,7 +95,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
if (next_gpr < PARAM_GPR_COUNT) {
dp->val.i32 = (int32_t)gprData[next_gpr++];
} else {
dp->val.i32 = (int32_t)*ap++;
get_value_and_advance(&dp->val.i32, ap);
}
break;
@@ -91,7 +103,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
if (next_gpr < PARAM_GPR_COUNT) {
dp->val.i64 = (int64_t)gprData[next_gpr++];
} else {
dp->val.i64 = (int64_t)*ap++;
get_value_and_advance(&dp->val.i64, ap);
}
break;
@@ -99,7 +111,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
if (next_gpr < PARAM_GPR_COUNT) {
dp->val.u8 = (uint8_t)gprData[next_gpr++];
} else {
dp->val.u8 = (uint8_t)*ap++;
get_value_and_advance(&dp->val.u8, ap);
}
break;
@@ -107,7 +119,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
if (next_gpr < PARAM_GPR_COUNT) {
dp->val.u16 = (uint16_t)gprData[next_gpr++];
} else {
dp->val.u16 = (uint16_t)*ap++;
get_value_and_advance(&dp->val.u16, ap);
}
break;
@@ -115,7 +127,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
if (next_gpr < PARAM_GPR_COUNT) {
dp->val.u32 = (uint32_t)gprData[next_gpr++];
} else {
dp->val.u32 = (uint32_t)*ap++;
get_value_and_advance(&dp->val.u32, ap);
}
break;
@@ -123,7 +135,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
if (next_gpr < PARAM_GPR_COUNT) {
dp->val.u64 = (uint64_t)gprData[next_gpr++];
} else {
dp->val.u64 = (uint64_t)*ap++;
get_value_and_advance(&dp->val.u64, ap);
}
break;
@@ -131,7 +143,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
if (next_fpr < PARAM_FPR_COUNT) {
memcpy(&dp->val.f, &fprData[next_fpr++], sizeof(dp->val.f));
} else {
memcpy(&dp->val.f, ap++, sizeof(dp->val.f));
get_value_and_advance(&dp->val.f, ap);
}
break;
@@ -139,15 +151,17 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
if (next_fpr < PARAM_FPR_COUNT) {
memcpy(&dp->val.d, &fprData[next_fpr++], sizeof(dp->val.d));
} else {
memcpy(&dp->val.d, ap++, sizeof(dp->val.d));
get_value_and_advance(&dp->val.d, ap);
}
break;
case nsXPTType::T_BOOL:
if (next_gpr < PARAM_GPR_COUNT) {
dp->val.b = (bool)gprData[next_gpr++];
dp->val.b = (bool)(uint8_t)gprData[next_gpr++];
} else {
dp->val.b = (bool)*ap++;
uint8_t value;
get_value_and_advance(&value, ap);
dp->val.b = (bool)value;
}
break;
@@ -155,7 +169,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
if (next_gpr < PARAM_GPR_COUNT) {
dp->val.c = (char)gprData[next_gpr++];
} else {
dp->val.c = (char)*ap++;
get_value_and_advance(&dp->val.c, ap);
}
break;
@@ -163,7 +177,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
if (next_gpr < PARAM_GPR_COUNT) {
dp->val.wc = (wchar_t)gprData[next_gpr++];
} else {
dp->val.wc = (wchar_t)*ap++;
get_value_and_advance(&dp->val.wc, ap);
}
break;
@@ -173,7 +187,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
}
}
result = self->mOuter->CallMethod((uint16_t)methodIndex, info, dispatchParams);
nsresult result = self->mOuter->CallMethod((uint16_t)methodIndex, info, dispatchParams);
if (dispatchParams != paramBuffer) {
delete [] dispatchParams;
@@ -182,26 +196,34 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
return result;
}
#ifdef __APPLE__
#define GNU(str)
#define UNDERSCORE "__"
#else
#define GNU(str) str
#define UNDERSCORE "_"
#endif
// Load w17 with the constant 'n' and branch to SharedStub().
# define STUB_ENTRY(n) \
__asm__ ( \
".section \".text\" \n\t" \
".text\n\t" \
".align 2\n\t" \
".if "#n" < 10 \n\t" \
".globl _ZN14nsXPTCStubBase5Stub"#n"Ev \n\t" \
".hidden _ZN14nsXPTCStubBase5Stub"#n"Ev \n\t" \
".type _ZN14nsXPTCStubBase5Stub"#n"Ev,@function \n\n" \
"_ZN14nsXPTCStubBase5Stub"#n"Ev: \n\t" \
".globl " UNDERSCORE "ZN14nsXPTCStubBase5Stub"#n"Ev \n\t" \
GNU(".hidden _ZN14nsXPTCStubBase5Stub"#n"Ev \n\t") \
GNU(".type _ZN14nsXPTCStubBase5Stub"#n"Ev,@function \n\n")\
"" UNDERSCORE "ZN14nsXPTCStubBase5Stub"#n"Ev: \n\t" \
".elseif "#n" < 100 \n\t" \
".globl _ZN14nsXPTCStubBase6Stub"#n"Ev \n\t" \
".hidden _ZN14nsXPTCStubBase6Stub"#n"Ev \n\t" \
".type _ZN14nsXPTCStubBase6Stub"#n"Ev,@function \n\n" \
"_ZN14nsXPTCStubBase6Stub"#n"Ev: \n\t" \
".globl " UNDERSCORE "ZN14nsXPTCStubBase6Stub"#n"Ev \n\t" \
GNU(".hidden _ZN14nsXPTCStubBase6Stub"#n"Ev \n\t") \
GNU(".type _ZN14nsXPTCStubBase6Stub"#n"Ev,@function \n\n")\
"" UNDERSCORE "ZN14nsXPTCStubBase6Stub"#n"Ev: \n\t" \
".elseif "#n" < 1000 \n\t" \
".globl _ZN14nsXPTCStubBase7Stub"#n"Ev \n\t" \
".hidden _ZN14nsXPTCStubBase7Stub"#n"Ev \n\t" \
".type _ZN14nsXPTCStubBase7Stub"#n"Ev,@function \n\n" \
"_ZN14nsXPTCStubBase7Stub"#n"Ev: \n\t" \
".globl " UNDERSCORE "ZN14nsXPTCStubBase7Stub"#n"Ev \n\t" \
GNU(".hidden _ZN14nsXPTCStubBase7Stub"#n"Ev \n\t") \
GNU(".type _ZN14nsXPTCStubBase7Stub"#n"Ev,@function \n\n")\
UNDERSCORE "ZN14nsXPTCStubBase7Stub"#n"Ev: \n\t" \
".else \n\t" \
".err \"stub number "#n" >= 1000 not yet supported\"\n" \
".endif \n\t" \
@@ -2,16 +2,30 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifdef __APPLE__
#define SYM(x) _ ## x
#else
#define SYM(x) x
#endif
.set NGPREGS,8
.set NFPREGS,8
.section ".text"
.text
.align 2
.globl SharedStub
#ifndef __APPLE__
.hidden SharedStub
.type SharedStub,@function
#endif
SharedStub:
.cfi_startproc
stp x29, x30, [sp,#-16]!
.cfi_adjust_cfa_offset 16
.cfi_rel_offset x29, 0
.cfi_rel_offset x30, 8
mov x29, sp
.cfi_def_cfa_register x29
sub sp, sp, #8*(NGPREGS+NFPREGS)
stp x0, x1, [sp, #64+(0*8)]
@@ -30,10 +44,19 @@ SharedStub:
add x3, sp, #8*NFPREGS
add x4, sp, #0
bl PrepareAndDispatch
bl SYM(PrepareAndDispatch)
add sp, sp, #8*(NGPREGS+NFPREGS)
.cfi_def_cfa_register sp
ldp x29, x30, [sp],#16
.cfi_adjust_cfa_offset -16
.cfi_restore x29
.cfi_restore x30
ret
.cfi_endproc
#ifndef __APPLE__
.size SharedStub, . - SharedStub
.section .note.GNU-stack, "", @progbits
#endif
@@ -11,6 +11,8 @@
#include "xptcstubs_ppc_rhapsody.cpp"
#elif defined(__arm__)
#include "xptcstubs_arm.cpp"
#elif defined(__aarch64__)
#include "xptcstubs_aarch64.cpp"
#else
#error unknown cpu architecture
#endif