Skip to content
This repository has been archived by the owner on Jun 19, 2019. It is now read-only.

Commit

Permalink
Merge pull request #118 from ehsan/sm-upgrade
Browse files Browse the repository at this point in the history
Upgrade SpiderMonkey to the latest trunk
  • Loading branch information
ehsan committed May 19, 2016
2 parents 91630a6 + 121ce5e commit 26163dd
Show file tree
Hide file tree
Showing 141 changed files with 7,182 additions and 4,712 deletions.
10 changes: 5 additions & 5 deletions deps/spidershim/scripts/update-from-upstream.sh
Expand Up @@ -24,14 +24,13 @@ rsync -av --delete "$SM_DIR"/Makefile.in spidermonkey/
rsync -av --delete "$SM_DIR"/configure.py spidermonkey/
rsync -av --delete "$SM_DIR"/build spidermonkey/
rsync -av --delete "$SM_DIR"/testing/mozbase spidermonkey/testing/
rsync -av --delete "$SM_DIR"/testing/moz.build spidermonkey/testing/
rsync -av --delete "$SM_DIR"/config spidermonkey/
rsync -av --delete "$SM_DIR"/intl/icu spidermonkey/intl/
test -d spidermonkey/layout/tools/reftest || mkdir -p spidermonkey/layout/tools/reftest
rsync -av --delete "$SM_DIR"/layout/tools/reftest/reftest spidermonkey/layout/tools/reftest/
test -d spidermonkey/dom/bindings || mkdir -p spidermonkey/dom/bindings
rsync -av --delete "$SM_DIR"/dom/bindings/mozwebidlcodegen spidermonkey/dom/bindings/
test -d spidermonkey/toolkit/mozapps || mkdir -p spidermonkey/toolkit/mozapps
test -d spidermonkey/taskcluster || mkdir -p spidermonkey/taskcluster
rsync -av --delete "$SM_DIR"/taskcluster/moz.build spidermonkey/taskcluster/
rsync -av --delete "$SM_DIR"/toolkit/mozapps/installer spidermonkey/toolkit/mozapps/
rsync -av --delete "$SM_DIR"/modules/fdlibm spidermonkey/modules/
rsync -av --delete "$SM_DIR"/js/src spidermonkey/js/
Expand All @@ -42,12 +41,13 @@ for patch in `ls spidermonkey-patches/* | sort`; do
(cd spidermonkey && patch -p1 < "../$patch")
done

scripts/build-spidermonkey-files.py && git add spidermonkey-files.gypi

git add spidermonkey
# The following will fail if there are no deleted files, so || with true.
git rm -r `git ls-files --deleted spidermonkey` || true
# The following will fail if there are no added files, so || with true.
git add -f `git ls-files --others spidermonkey` || true

scripts/build-spidermonkey-files.py && git add spidermonkey-files.gypi

rev=`(cd "$SM_DIR" && git rev-parse HEAD)`
git commit -m "Syncing SpiderMonkey from Mozilla upstream revision $rev"
19 changes: 10 additions & 9 deletions deps/spidershim/spidermonkey-files.gypi
Expand Up @@ -174,6 +174,7 @@
'spidermonkey/build/moz.configure/java.configure',
'spidermonkey/build/moz.configure/memory.configure',
'spidermonkey/build/moz.configure/old.configure',
'spidermonkey/build/moz.configure/pkg.configure',
'spidermonkey/build/moz.configure/toolchain.configure',
'spidermonkey/build/moz.configure/util.configure',
'spidermonkey/build/mozconfig.automation',
Expand Down Expand Up @@ -1014,13 +1015,6 @@
'spidermonkey/config/version.mk',
'spidermonkey/config/version_win.pl',
'spidermonkey/configure.py',
'spidermonkey/dom/bindings/mozwebidlcodegen/__init__.py',
'spidermonkey/dom/bindings/mozwebidlcodegen/test/Child.webidl',
'spidermonkey/dom/bindings/mozwebidlcodegen/test/DummyBinding.webidl',
'spidermonkey/dom/bindings/mozwebidlcodegen/test/ExampleBinding.webidl',
'spidermonkey/dom/bindings/mozwebidlcodegen/test/Parent.webidl',
'spidermonkey/dom/bindings/mozwebidlcodegen/test/TestEvent.webidl',
'spidermonkey/dom/bindings/mozwebidlcodegen/test/test_mozwebidlcodegen.py',
'spidermonkey/intl/icu/SVN-INFO',
'spidermonkey/intl/icu/source/Doxyfile.in',
'spidermonkey/intl/icu/source/Makefile.in',
Expand Down Expand Up @@ -4122,10 +4116,13 @@
'spidermonkey/js/src/asmjs/AsmJS.h',
'spidermonkey/js/src/asmjs/Wasm.cpp',
'spidermonkey/js/src/asmjs/Wasm.h',
'spidermonkey/js/src/asmjs/WasmAST.h',
'spidermonkey/js/src/asmjs/WasmBinary.cpp',
'spidermonkey/js/src/asmjs/WasmBinary.h',
'spidermonkey/js/src/asmjs/WasmBinaryIterator.cpp',
'spidermonkey/js/src/asmjs/WasmBinaryIterator.h',
'spidermonkey/js/src/asmjs/WasmBinaryToAST.cpp',
'spidermonkey/js/src/asmjs/WasmBinaryToAST.h',
'spidermonkey/js/src/asmjs/WasmBinaryToText.cpp',
'spidermonkey/js/src/asmjs/WasmBinaryToText.h',
'spidermonkey/js/src/asmjs/WasmFrameIterator.cpp',
Expand Down Expand Up @@ -4548,6 +4545,7 @@
'spidermonkey/js/src/devtools/automation/variants/arm64-sim',
'spidermonkey/js/src/devtools/automation/variants/compacting',
'spidermonkey/js/src/devtools/automation/variants/dtrace',
'spidermonkey/js/src/devtools/automation/variants/nonunified',
'spidermonkey/js/src/devtools/automation/variants/plain',
'spidermonkey/js/src/devtools/automation/variants/plaindebug',
'spidermonkey/js/src/devtools/automation/variants/rootanalysis',
Expand Down Expand Up @@ -5241,6 +5239,7 @@
'spidermonkey/js/src/jit-test/tests/auto-regress/bug1264823.js',
'spidermonkey/js/src/jit-test/tests/auto-regress/bug1266579.js',
'spidermonkey/js/src/jit-test/tests/auto-regress/bug1268034.js',
'spidermonkey/js/src/jit-test/tests/auto-regress/bug1269074.js',
'spidermonkey/js/src/jit-test/tests/auto-regress/bug464116.js',
'spidermonkey/js/src/jit-test/tests/auto-regress/bug466076.js',
'spidermonkey/js/src/jit-test/tests/auto-regress/bug466654.js',
Expand Down Expand Up @@ -10444,6 +10443,7 @@
'spidermonkey/js/src/jsapi-tests/testDefineGetterSetterNonEnumerable.cpp',
'spidermonkey/js/src/jsapi-tests/testDefineProperty.cpp',
'spidermonkey/js/src/jsapi-tests/testDefinePropertyIgnoredAttributes.cpp',
'spidermonkey/js/src/jsapi-tests/testDeflateStringToUTF8Buffer.cpp',
'spidermonkey/js/src/jsapi-tests/testDifferentNewTargetInvokeConstructor.cpp',
'spidermonkey/js/src/jsapi-tests/testEnclosingFunction.cpp',
'spidermonkey/js/src/jsapi-tests/testErrorCopying.cpp',
Expand Down Expand Up @@ -12750,6 +12750,7 @@
'spidermonkey/js/src/tests/ecma_6/TypedArray/constructor-ArrayBuffer-species.js',
'spidermonkey/js/src/tests/ecma_6/TypedArray/constructor-non-detached.js',
'spidermonkey/js/src/tests/ecma_6/TypedArray/constructor-not-callable.js',
'spidermonkey/js/src/tests/ecma_6/TypedArray/constructor_bad-args.js',
'spidermonkey/js/src/tests/ecma_6/TypedArray/detached-array-buffer-checks.js',
'spidermonkey/js/src/tests/ecma_6/TypedArray/element-setting-converts-using-ToNumber.js',
'spidermonkey/js/src/tests/ecma_6/TypedArray/entries.js',
Expand Down Expand Up @@ -18724,7 +18725,6 @@
'spidermonkey/js/src/vtune/ittnotify_types.h',
'spidermonkey/js/src/vtune/jitprofiling.c',
'spidermonkey/js/src/vtune/jitprofiling.h',
'spidermonkey/layout/tools/reftest/reftest/__init__.py',
'spidermonkey/memory/build/jemalloc_config.cpp',
'spidermonkey/memory/build/malloc_decls.h',
'spidermonkey/memory/build/moz.build',
Expand Down Expand Up @@ -21068,6 +21068,7 @@
'spidermonkey/python/mozlint/mozlint/formatters/__init__.py',
'spidermonkey/python/mozlint/mozlint/formatters/stylish.py',
'spidermonkey/python/mozlint/mozlint/parser.py',
'spidermonkey/python/mozlint/mozlint/pathutils.py',
'spidermonkey/python/mozlint/mozlint/result.py',
'spidermonkey/python/mozlint/mozlint/roller.py',
'spidermonkey/python/mozlint/mozlint/types.py',
Expand Down Expand Up @@ -21601,7 +21602,7 @@
'spidermonkey/python/which/test/test_which.py',
'spidermonkey/python/which/test/testsupport.py',
'spidermonkey/python/which/which.py',
'spidermonkey/testing/moz.build',
'spidermonkey/taskcluster/moz.build',
'spidermonkey/testing/mozbase/README.md',
'spidermonkey/testing/mozbase/docs/Makefile',
'spidermonkey/testing/mozbase/docs/_static/structured_example.py',
Expand Down
3 changes: 2 additions & 1 deletion deps/spidershim/spidermonkey/build/autoconf/android.m4
Expand Up @@ -9,7 +9,7 @@ MOZ_ARG_WITH_STRING(android-cxx-stl,
[ --with-android-cxx-stl=VALUE
use the specified C++ STL (stlport, libstdc++, libc++)],
android_cxx_stl=$withval,
android_cxx_stl=mozstlport)
android_cxx_stl=libc++)
define([MIN_ANDROID_VERSION], [9])
android_version=MIN_ANDROID_VERSION
Expand Down Expand Up @@ -341,6 +341,7 @@ case "$target" in
AC_SUBST(ANDROID_TOOLS)
MOZ_ANDROID_AAR(appcompat-v7, 23.0.1, android, com/android/support)
MOZ_ANDROID_AAR(cardview-v7, 23.0.1, android, com/android/support)
MOZ_ANDROID_AAR(design, 23.0.1, android, com/android/support)
MOZ_ANDROID_AAR(recyclerview-v7, 23.0.1, android, com/android/support)
MOZ_ANDROID_AAR(support-v4, 23.0.1, android, com/android/support, REQUIRED_INTERNAL_IMPL)
Expand Down
6 changes: 2 additions & 4 deletions deps/spidershim/spidermonkey/build/autoconf/pkg.m4
Expand Up @@ -5,14 +5,12 @@ dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
# PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
# defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
# also defines GSTUFF_PKG_ERRORS on error
# PKG_CONFIG is set by Python configure, if it is empty here it could not
# be found.
AC_DEFUN([PKG_CHECK_MODULES],
[succeeded=no
if test -z "$PKG_CONFIG"; then
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
fi
if test "$PKG_CONFIG" = "no" ; then
echo "*** The pkg-config script could not be found. Make sure it is"
echo "*** in your path, or set the PKG_CONFIG environment variable"
echo "*** to the full path to pkg-config."
Expand Down
2 changes: 2 additions & 0 deletions deps/spidershim/spidermonkey/build/mach_bootstrap.py
Expand Up @@ -77,6 +77,7 @@
'dom/media/test/external',
'layout/tools/reftest',
'other-licenses/ply',
'taskcluster',
'testing',
'testing/firefox-ui/harness',
'testing/firefox-ui/tests',
Expand Down Expand Up @@ -129,6 +130,7 @@
'python/mozbuild/mozbuild/compilation/codecomplete.py',
'python/mozbuild/mozbuild/frontend/mach_commands.py',
'services/common/tests/mach_commands.py',
'taskcluster/mach_commands.py',
'testing/firefox-ui/mach_commands.py',
'testing/luciddream/mach_commands.py',
'testing/mach_commands.py',
Expand Down
23 changes: 23 additions & 0 deletions deps/spidershim/spidermonkey/build/moz.configure/init.configure
Expand Up @@ -684,6 +684,25 @@ set_define('RELEASE_BUILD', delayed_getattr(milestone, 'is_release'))
add_old_configure_assignment('RELEASE_BUILD',
delayed_getattr(milestone, 'is_release'))

# The app update channel is 'default' when not supplied. The value is used in
# the application's confvars.sh (and is made available to a project specific
# moz.configure).
option('--enable-update-channel',
nargs=1,
help='Select application update channel',
default='default')

@depends('--enable-update-channel')
def update_channel(channel):
if channel[0] == '':
return 'default'
return channel[0].lower()

set_config('MOZ_UPDATE_CHANNEL', update_channel)
set_define('MOZ_UPDATE_CHANNEL', update_channel)
add_old_configure_assignment('MOZ_UPDATE_CHANNEL', update_channel)


# A template providing a shorthand for setting a variable. The created
# option will only be settable with imply_option.
# It is expected that a project-specific moz.configure will call imply_option
Expand Down Expand Up @@ -770,4 +789,8 @@ def js_option(*args, **kwargs):
add_old_configure_arg(js_option)


include('pkg.configure')
# Make this assignment here rather than in pkg.configure to avoid
# requiring this file in unit tests.
add_old_configure_assignment('PKG_CONFIG', pkg_config)
include(include_project_configure)
Expand Up @@ -248,7 +248,6 @@ def old_configure_options(*options):
'--enable-system-cairo',
'--enable-system-extension-dirs',
'--enable-system-ffi',
'--enable-system-hunspell',
'--enable-system-pixman',
'--enable-system-sqlite',
'--enable-tasktracer',
Expand All @@ -258,7 +257,6 @@ def old_configure_options(*options):
'--enable-tree-freetype',
'--enable-ui-locale',
'--enable-universalchardet',
'--enable-update-channel',
'--enable-updater',
'--enable-url-classifier',
'--enable-valgrind',
Expand Down
86 changes: 86 additions & 0 deletions deps/spidershim/spidermonkey/build/moz.configure/pkg.configure
@@ -0,0 +1,86 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# 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/.

pkg_config = check_prog('PKG_CONFIG', ('pkg-config',), allow_missing=True)

@depends_if(pkg_config)
@checking('for pkg-config version')
@imports('subprocess')
def pkg_config_version(pkg_config):
return Version(check_cmd_output(pkg_config, '--version').rstrip())

# Locates the given module using pkg-config.
# - `var` determines the name of variables to set when the package is found.
# <var>_CFLAGS and <var>_LIBS are set with corresponding values.
# - `package_desc` package name and version requirement string, list of
# strings describing packages to locate, or depends function that will
# resolve to such a string or list of strings.
# - `condition` a depends function that will determine whether to perform
# any checks (default is to always perform checks).
# - `allow_missing` If set, failure to fulfill the package description
# will not result in an error or logged message, and any error message
# will be returned to the caller.
# Returns `True` when the package description is fulfilled.
@template
@imports(_from='mozbuild.configure', _import='DependsFunction')
def pkg_check_modules(var, package_desc,
condition=depends('--help')(lambda _: True),
allow_missing=False):
if isinstance(package_desc, (tuple, list)):
package_desc = ' '.join(package_desc)
if not isinstance(package_desc, DependsFunction):
package_desc = depends('--help')(lambda _: package_desc)

@depends_when(pkg_config, pkg_config_version, when=condition)
def check_pkg_config(pkg_config, version):
min_version = '0.9.0'
if pkg_config is None:
die("*** The pkg-config script could not be found. Make sure it is\n"
"*** in your path, or set the PKG_CONFIG environment variable\n"
"*** to the full path to pkg-config.")
if version < min_version:
die("*** Your version of pkg-config is too old. You need version %s or newer.",
min_version)

@depends_when(pkg_config, package_desc, when=condition)
@imports('subprocess')
@imports('sys')
@imports(_from='mozbuild.configure.util', _import='LineIO')
def package(pkg_config, package_desc):
# package_desc may start as a depends function, so we can't use
# @checking here.
log.info("checking for %s... " % package_desc)
with log.queue_debug():
try:
subprocess.check_output([pkg_config, '--errors-to-stdout',
'--print-errors', package_desc])
log.info("yes")
return True
except subprocess.CalledProcessError as e:
log.info("no")
log_writer = log.warning if allow_missing else log.error
with LineIO(lambda l: log_writer(l)) as o:
o.write(e.output)
if not allow_missing:
sys.exit(1)

@depends_when(pkg_config, package_desc, when=package)
@checking('%s_CFLAGS' % var, callback=lambda t: ' '.join(t))
def pkg_cflags(pkg_config, package_desc):
flags = check_cmd_output(pkg_config, '--cflags', package_desc)
return tuple(flags.split())

@depends_when(pkg_config, package_desc, when=package)
@checking('%s_LIBS' % var, callback=lambda t: ' '.join(t))
def pkg_libs(pkg_config, package_desc):
libs = check_cmd_output(pkg_config, '--libs', package_desc)
# Remove evil flags like -Wl,--export-dynamic
return tuple(libs.replace('-Wl,--export-dynamic', '').split())

set_config('%s_CFLAGS' % var, pkg_cflags)
set_config('%s_LIBS' % var, pkg_libs)

return package
Expand Up @@ -10,15 +10,12 @@ yasm = check_prog('YASM', ['yasm'], allow_missing=True)

@depends_if(yasm)
@checking('yasm version')
@imports('subprocess')
def yasm_version(yasm):
try:
version = Version(subprocess.check_output(
[yasm, '--version']
).splitlines()[0].split()[1])
return version
except subprocess.CalledProcessError as e:
die('Failed to get yasm version: %s', e.message)
version = check_cmd_output(
yasm, '--version',
onerror=lambda: die('Failed to get yasm version.')
).splitlines()[0].split()[1]
return version

# Until we move all the yasm consumers out of old-configure.
# bug 1257904
Expand Down Expand Up @@ -174,7 +171,6 @@ add_old_configure_assignment('TOOLCHAIN_PREFIX', toolchain_prefix)
@imports('os')
@imports('subprocess')
@imports(_from='mozbuild.configure.util', _import='LineIO')
@imports(_from='mozbuild.shellutil', _import='quote')
@imports(_from='tempfile', _import='mkstemp')
def try_preprocess(compiler, language, source):
suffix = {
Expand All @@ -192,22 +188,8 @@ def try_preprocess(compiler, language, source):

os.write(fd, source)
os.close(fd)

cmd = compiler + ['-E', path]
log.debug('Executing: `%s`', quote(*cmd))
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = proc.communicate()
retcode = proc.wait()
if retcode == 0:
return stdout

log.debug('The command returned non-zero exit status %d.', retcode)
for out, desc in ((stdout, 'output'), (stderr, 'error output')):
if out:
log.debug('Its %s was:', desc)
with LineIO(lambda l: log.debug('| %s', l)) as o:
o.write(out)
return check_cmd_output(*cmd)
finally:
os.remove(path)

Expand Down

0 comments on commit 26163dd

Please sign in to comment.