Skip to content

Commit

Permalink
Auto merge of #186 - jdm:smup67, r=asajeffrey
Browse files Browse the repository at this point in the history
Upgrade to SpiderMonkey 67

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/mozjs/186)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo authored Jun 26, 2019
2 parents 4e2062a + 220ffbe commit b2f8393
Show file tree
Hide file tree
Showing 13,898 changed files with 184,643 additions and 187,527 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "mozjs_sys"
description = "System crate for the Mozilla SpiderMonkey JavaScript engine."
repository = "https://github.com/servo/mozjs/"
version = "0.66.1"
version = "0.67.0"
authors = ["Mozilla"]
links = "mozjs"
build = "build.rs"
Expand Down
2 changes: 1 addition & 1 deletion etc/COMMIT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9c35dcbaa8999f989f14f1e98a4a40a43f234131
455c1065dcbe14b73771df2db56aae43a44dfcf8
15 changes: 0 additions & 15 deletions etc/patches/broken-sdk.patch

This file was deleted.

6 changes: 3 additions & 3 deletions etc/patches/configure-override-android-ndk-paths.patch
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@ index 66cf3e16ad..8f0b0582b3 100644
+ if value:
+ return value[0]
+
llvm_path = '%s/toolchains/llvm/prebuilt/%s-%s/bin' % (ndk,
host.kernel.lower(),
host.cpu)
llvm_format = '%s/toolchains/llvm/prebuilt/%s-%s/bin'
llvm_path = llvm_format % (ndk, host.kernel.lower(), host.cpu)
if not isdir(llvm_path) and host.cpu == 'x86_64':
14 changes: 14 additions & 0 deletions etc/patches/no_bindgen_in_configure.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/mozjs/build/moz.configure/bindgen.configure b/mozjs/build/moz.configure/bindgen.configure
index 1658c8f93e..f7082ea6d4 100644
--- a/mozjs/build/moz.configure/bindgen.configure
+++ b/mozjs/build/moz.configure/bindgen.configure
@@ -246,6 +246,9 @@ set_config('MOZ_CLANG_PATH', bindgen_config_paths.clang_path)
@depends(target, target_is_unix, cxx_compiler, bindgen_cflags_android,
bindgen_config_paths.clang_path)
def basic_bindgen_cflags(target, is_unix, compiler_info, android_cflags, clang_path):
+ if not clang_path:
+ return []
+
args = [
'-x', 'c++', '-fno-sized-deallocation',
'-DTRACING=1', '-DIMPL_LIBXUL', '-DMOZILLA_INTERNAL_API',
2 changes: 1 addition & 1 deletion etc/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def remove_cargo_tomls():
os.path.join("mozjs", "testing"),
]
exclude = [
os.path.join("mozjs", "js", "src", "frontend", "binsource"),
os.path.join("mozjs", "js", "src", "frontend", "binast"),
]
for dir in problem_dirs:
for root, dirs, files in os.walk(dir):
Expand Down
5 changes: 5 additions & 0 deletions mozjs/.cargo/config.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ git = "https://github.com/froydnj/winapi-rs"
branch = "aarch64"
replace-with = "vendored-sources"

[source."https://github.com/alexcrichton/cc-rs"]
git = "https://github.com/glandium/cc-rs"
branch = "1.0.23-clang-cl-aarch64"
replace-with = "vendored-sources"

[source.vendored-sources]
directory = '@top_srcdir@/third_party/rust'

Expand Down
22 changes: 13 additions & 9 deletions mozjs/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,19 @@ binaries::
@$(MAKE) install-manifests install_manifests=dist/include
endif

# Host binaries are not produced for macOS consumers: that is, there's
# no macOS-hosted job to produce them at this time. Therefore we
# enable --host-bins only for automation builds, which only require Linux and
# Windows host binaries.
recurse_artifact:
$(topsrcdir)/mach --log-no-times artifact install
$(topsrcdir)/mach --log-no-times artifact install$(if $(MOZ_ARTIFACT_BUILD_SYMBOLS), --symbols$(addprefix =,$(filter full,$(MOZ_ARTIFACT_BUILD_SYMBOLS))))$(if $(MOZ_AUTOMATION), --host-bins)

ifdef MOZ_EME_WIN32_ARTIFACT
recurse_win32-artifact:
rm -rf $(DIST)/i686
$(topsrcdir)/mach --log-no-times artifact install --job $(if $(MOZ_PGO),win32-pgo,win32-opt) --no-tests --distdir $(DIST)/i686
mv $(DIST)/i686/bin/* $(DIST)/i686
endif

ifdef MOZ_WIDGET_TOOLKIT
ifdef ENABLE_TESTS
Expand All @@ -180,7 +191,7 @@ default all::
profiledbuild::
$(call BUILDSTATUS,TIERS pgo_profile_generate pgo_package pgo_profile pgo_clobber pgo_profile_use)
$(call BUILDSTATUS,TIER_START pgo_profile_generate)
$(MAKE) default MOZ_PROFILE_GENERATE=1
$(MAKE) default MOZ_PROFILE_GENERATE=1 MOZ_LTO=
$(call BUILDSTATUS,TIER_FINISH pgo_profile_generate)
$(call BUILDSTATUS,TIER_START pgo_package)
$(MAKE) package MOZ_INTERNAL_SIGNING_FORMAT= MOZ_EXTERNAL_SIGNING_FORMAT=
Expand Down Expand Up @@ -272,22 +283,15 @@ update-packaging:
package-generated-sources:
$(call py_action,package_generated_sources,'$(DIST)/$(PKG_PATH)$(GENERATED_SOURCE_FILE_PACKAGE)')

#XXX: this is a hack, since we don't want to clobber for MSVC
# PGO support, but we can't do this test in client.mk
# No point in clobbering if PGO has been explicitly disabled.
ifdef NO_PROFILE_GUIDED_OPTIMIZE
maybe_clobber_profiledbuild:
else
ifneq ($(CC_TYPE),msvc)
maybe_clobber_profiledbuild: clean
ifneq (,$(findstring clang,$(CC_TYPE)))
$(LLVM_PROFDATA) merge -o $(DEPTH)/merged.profdata $(DEPTH)/*.profraw
endif
else
maybe_clobber_profiledbuild:
$(RM) $(DIST)/bin/*.pgc
find $(DIST)/$(MOZ_APP_NAME) -name '*.pgc' -exec mv {} $(DIST)/bin \;
endif # msvc
endif # NO_PROFILE_GUIDED_OPTIMIZE

.PHONY: maybe_clobber_profiledbuild
Expand Down
8 changes: 4 additions & 4 deletions mozjs/README
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
This directory contains SpiderMonkey 66.
This directory contains SpiderMonkey 67.

This release is based on a revision of Mozilla 66:
This release is based on a revision of Mozilla 67:
https://hg.mozilla.org/releases/
The changes in the patches/ directory were applied.

MDN hosts the latest SpiderMonkey 66 release notes:
https://developer.mozilla.org/en-US/docs/SpiderMonkey/66
MDN hosts the latest SpiderMonkey 67 release notes:
https://developer.mozilla.org/en-US/docs/SpiderMonkey/67
6 changes: 6 additions & 0 deletions mozjs/build/autoconf/alloc.m4
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,11 @@ AC_EGREP_HEADER(valloc, unistd.h,
AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no]))
AC_MSG_CHECKING([for _aligned_malloc in malloc.h])
AC_EGREP_HEADER(_aligned_malloc, malloc.h,
AC_DEFINE(HAVE_ALIGNED_MALLOC)
AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no]))
])
83 changes: 1 addition & 82 deletions mozjs/build/autoconf/android.m4
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ case "$target" in
CXXFLAGS="-fno-short-enums -fno-exceptions $CXXFLAGS $stlport_cppflags"
ASFLAGS="$directory_include_args -DANDROID $ASFLAGS"
dnl Add --allow-shlib-undefined, because libGLESv2 links to an
dnl undefined symbol (present on the hardware, just not in the
dnl NDK.)
LDFLAGS="-L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform -Wl,--allow-shlib-undefined $LDFLAGS"
LDFLAGS="-L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform $LDFLAGS"
ANDROID_PLATFORM="${android_platform}"
AC_DEFINE(ANDROID)
Expand Down Expand Up @@ -91,87 +88,9 @@ AC_SUBST_LIST([STLPORT_LIBS])


dnl Configure an Android SDK.
dnl Arg 1: compile SDK version, like 23.
dnl Arg 2: target SDK version, like 23.
dnl Arg 3: list of build-tools versions, like "23.0.3 23.0.1".
AC_DEFUN([MOZ_ANDROID_SDK],
[
MOZ_ARG_WITH_STRING(android-sdk,
[ --with-android-sdk=DIR
location where the Android SDK can be found (like ~/.mozbuild/android-sdk-linux)],
android_sdk_root=$withval)
android_sdk_root=${withval%/platforms/android-*}
case "$target" in
*-android*|*-linuxandroid*)
if test -z "$android_sdk_root" ; then
AC_MSG_ERROR([You must specify --with-android-sdk=/path/to/sdk when targeting Android.])
fi
# We were given an old-style
# --with-android-sdk=/path/to/sdk/platforms/android-*. We could warn, but
# we'll get compliance by forcing the issue.
if test -e "$withval"/source.properties ; then
AC_MSG_ERROR([Including platforms/android-* in --with-android-sdk arguments is deprecated. Use --with-android-sdk=$android_sdk_root.])
fi
android_target_sdk=$2
AC_MSG_CHECKING([for Android build-tools])
android_build_tools_base="$android_sdk_root"/build-tools
for version in $3; do
android_build_tools="$android_build_tools_base"/$version
if test -d "$android_build_tools" -a -f "$android_build_tools/zipalign"; then
AC_MSG_RESULT([$android_build_tools])
break
fi
done
MOZ_PATH_PROG(ZIPALIGN, zipalign, :, [$android_build_tools])
if test -z "$ZIPALIGN" -o "$ZIPALIGN" = ":"; then
AC_MSG_ERROR([The program zipalign was not found. Try |mach bootstrap|.])
fi
android_platform_tools="$android_sdk_root"/platform-tools
AC_MSG_CHECKING([for Android platform-tools])
if test -d "$android_platform_tools" -a -f "$android_platform_tools/adb"; then
AC_MSG_RESULT([$android_platform_tools])
else
AC_MSG_ERROR([You must install the Android platform-tools. Try |mach bootstrap|. (Looked for $android_platform_tools)])
fi
MOZ_PATH_PROG(ADB, adb, :, [$android_platform_tools])
if test -z "$ADB" -o "$ADB" = ":"; then
AC_MSG_ERROR([The program adb was not found. Try |mach bootstrap|.])
fi
android_tools="$android_sdk_root"/tools
AC_MSG_CHECKING([for Android tools])
if test -d "$android_tools" -a -f "$android_tools/emulator"; then
AC_MSG_RESULT([$android_tools])
else
AC_MSG_ERROR([You must install the Android tools. Try |mach bootstrap|. (Looked for $android_tools)])
fi
dnl Android Tools 26 changes emulator path.
dnl Although android_sdk_root/tools still has emulator command,
dnl it doesn't work correctly
MOZ_PATH_PROG(EMULATOR, emulator, :, [$android_sdk_root/emulator:$android_tools])
if test -z "$EMULATOR" -o "$EMULATOR" = ":"; then
AC_MSG_ERROR([The program emulator was not found. Try |mach bootstrap|.])
fi
ANDROID_TARGET_SDK="${android_target_sdk}"
ANDROID_SDK_ROOT="${android_sdk_root}"
ANDROID_TOOLS="${android_tools}"
AC_SUBST(ANDROID_TARGET_SDK)
AC_SUBST(ANDROID_SDK_ROOT)
AC_SUBST(ANDROID_TOOLS)
;;
esac
MOZ_ARG_WITH_STRING(android-min-sdk,
[ --with-android-min-sdk=[VER] Impose a minimum Firefox for Android SDK version],
[ MOZ_ANDROID_MIN_SDK_VERSION=$withval ])
Expand Down
6 changes: 5 additions & 1 deletion mozjs/build/autoconf/clang-plugin.m4
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ if test -n "$ENABLE_CLANG_PLUGIN"; then
dnl For some reason the llvm-config downloaded from clang.llvm.org for clang3_8
dnl produces a -isysroot flag for a sysroot which might not ship when passed
dnl --cxxflags. We use sed to remove this argument so that builds work on OSX
LLVM_CXXFLAGS=`$LLVMCONFIG --cxxflags | sed -e 's/-isysroot [[^ ]]*//'`
dnl
dnl For a similar reason, we remove any -gcc-toolchain arguments, since the
dnl directories specified by such arguments might not exist on the current
dnl machine.
LLVM_CXXFLAGS=`$LLVMCONFIG --cxxflags | sed -e 's/-isysroot [[^ ]]*//' -e 's/-gcc-toolchain [[^ ]]*//'`
LLVM_LDFLAGS=`$LLVMCONFIG --ldflags | tr '\n' ' '`
Expand Down
2 changes: 1 addition & 1 deletion mozjs/build/autoconf/compiler-opts.m4
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -a -z "$MOZ_DISABLE_ICF" -a -z "$DEVELOPE
# the same address
if AC_TRY_COMMAND([${CC-cc} -o conftest${ac_exeext} $LDFLAGS -Wl,--icf=safe -ffunction-sections conftest.${ac_ext} $LIBS 1>&2]) &&
test -s conftest${ac_exeext} &&
objdump -t conftest${ac_exeext} | awk changequote(<<, >>)'{a[<<$>>6] = <<$>>1} END {if (a["foo"] && (a["foo"] != a["bar"])) { exit 1 }}'changequote([, ]); then
$LLVM_OBJDUMP -t conftest${ac_exeext} | awk changequote(<<, >>)'{a[<<$>>6] = <<$>>1} END {if (a["foo"] && (a["foo"] != a["bar"])) { exit 1 }}'changequote([, ]); then
LD_SUPPORTS_ICF=yes
else
LD_SUPPORTS_ICF=no
Expand Down
2 changes: 1 addition & 1 deletion mozjs/build/autoconf/expandlibs.m4
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ AC_CACHE_CHECK(what kind of list files are supported by the linker,
dnl https://sourceware.org/bugzilla/show_bug.cgi?id=23600
if AC_TRY_COMMAND(${CC-cc} -o conftest.${OBJ_SUFFIX} -c $MOZ_LTO_CFLAGS $CFLAGS $CPPFLAGS conftest.${ac_ext} 1>&5) && test -s conftest.${OBJ_SUFFIX}; then
echo "INPUT(conftest.${OBJ_SUFFIX})" > conftest.list
if test "$CC_TYPE" = "msvc" -o "$CC_TYPE" = "clang-cl"; then
if test "$CC_TYPE" = "clang-cl"; then
link="$LINKER -OUT:conftest${ac_exeext}"
else
link="${CC-cc} -o conftest${ac_exeext}"
Expand Down
10 changes: 10 additions & 0 deletions mozjs/build/autoconf/frameptr.m4
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ AC_DEFUN([MOZ_SET_FRAMEPTR_FLAGS], [
MOZ_DISABLE_FRAME_PTR="-fomit-frame-pointer -funwind-tables"
else
case "$target" in
dnl some versions of clang-cl don't support -Oy-; accommodate them.
aarch64-windows*)
if test "$CC_TYPE" = "clang-cl"; then
MOZ_ENABLE_FRAME_PTR="-Xclang -mdisable-fp-elim"
MOZ_DISABLE_FRAME_PTR="-Xclang -mdisable-fp-elim"
else
MOZ_ENABLE_FRAME_PTR="-Oy-"
MOZ_DISABLE_FRAME_PTR="-Oy"
fi
;;
dnl Oy (Frame-Pointer Omission) is only support on x86 compilers
*-mingw32*)
MOZ_ENABLE_FRAME_PTR="-Oy-"
Expand Down
14 changes: 14 additions & 0 deletions mozjs/build/autoconf/hooks.m4
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,17 @@ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
dnl Print error messages in config.log as well as stderr
define([AC_MSG_ERROR],
[{ echo "configure: error: $1" 1>&2; echo "configure: error: $1" 1>&5; exit 1; }])

dnl Divert AC_TRY_COMPILER to make ac_cv_prog_*_works actually cached.
dnl This will allow to just skip the test when python configure has set
dnl the value for us. But since ac_cv_prog_*_cross is calculated at the same
dnl time, and has a different meaning as in python configure, we only want to
dnl use its value to display whether a cross-compile is happening. We forbid
dnl configure tests that would rely on ac_cv_prog_*_cross autoconf meaning
dnl (being able to execute the product of compilation), which are already bad
dnl for cross compiles anyways, so it's a win to get rid of them.
define([_MOZ_AC_TRY_COMPILER], defn([AC_TRY_COMPILER]))
define([AC_TRY_COMPILER], [AC_CACHE_VAL($2, _MOZ_AC_TRY_COMPILER($1, $2, $3))])

define([AC_TRY_RUN], [m4_fatal([AC_TRY_RUN is forbidden])])
define([AC_CHECK_FILE], [m4_fatal([AC_CHECK_FILE is forbidden])])
34 changes: 34 additions & 0 deletions mozjs/build/build-clang/android-mangling-error.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Workaround segfault in clang's mangling code that is tickled when
attempting to mangle the declaration:
std:__ndk1::__find_detail::__find_exactly_one_checked::__matches
in the <tuple> header in the Android NDK.
This codepath is exercised by MozsearchIndexer.cpp (the searchfox
indexer) when indexing on Android. See also
https://bugs.llvm.org/show_bug.cgi?id=40747

diff --git a/clang/lib/AST/ItaniumMangle.cpp b/clang/lib/AST/ItaniumMangle.cpp
index 2dc04f2f3d8..054fc27003d 100644
--- a/clang/lib/AST/ItaniumMangle.cpp
+++ b/clang/lib/AST/ItaniumMangle.cpp
@@ -3495,16 +3495,21 @@ void CXXNameMangler::mangleExpression(const Expr *E, unsigned Arity) {
// ::= <expr-primary>
// <expr-primary> ::= L <type> <value number> E # integer literal
// ::= L <type <value float> E # floating literal
// ::= L <mangled-name> E # external name
// ::= fpT # 'this' expression
QualType ImplicitlyConvertedToType;

recurse:
+ if (!E) {
+ Out << "MOZ_WE_HACKED_AROUND_BUG_1500941";
+ return;
+ }
+
switch (E->getStmtClass()) {
case Expr::NoStmtClass:
#define ABSTRACT_STMT(Type)
#define EXPR(Type, Base)
#define STMT(Type, Base) \
case Expr::Type##Class:
#include "clang/AST/StmtNodes.inc"
// fallthrough
Loading

0 comments on commit b2f8393

Please sign in to comment.