From 1e5c31fb7c75355ed6373e6b49cbb2c13a21b3ba Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 15 Oct 2013 18:00:28 -0400 Subject: [PATCH 01/43] Bug 921753 - Part 6: Define gfxPatternDrawable's destructor out of line; r=seth --- gfx/thebes/gfxDrawable.cpp | 4 ++++ gfx/thebes/gfxDrawable.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gfx/thebes/gfxDrawable.cpp b/gfx/thebes/gfxDrawable.cpp index ccec0972d2fb..8153fb61acc4 100644 --- a/gfx/thebes/gfxDrawable.cpp +++ b/gfx/thebes/gfxDrawable.cpp @@ -188,6 +188,10 @@ gfxPatternDrawable::gfxPatternDrawable(gfxPattern* aPattern, { } +gfxPatternDrawable::~gfxPatternDrawable() +{ +} + class DrawingCallbackFromDrawable : public gfxDrawingCallback { public: DrawingCallbackFromDrawable(gfxDrawable* aDrawable) diff --git a/gfx/thebes/gfxDrawable.h b/gfx/thebes/gfxDrawable.h index 9e27639fda38..6216ecd78ac4 100644 --- a/gfx/thebes/gfxDrawable.h +++ b/gfx/thebes/gfxDrawable.h @@ -123,7 +123,7 @@ class gfxPatternDrawable : public gfxDrawable { public: gfxPatternDrawable(gfxPattern* aPattern, const gfxIntSize aSize); - virtual ~gfxPatternDrawable() {} + virtual ~gfxPatternDrawable(); virtual bool Draw(gfxContext* aContext, const gfxRect& aFillRect, From 134858c6dea3929be952f6dbcf5cf23b83ff3933 Mon Sep 17 00:00:00 2001 From: Jonathan Griffin Date: Tue, 15 Oct 2013 12:54:21 -0700 Subject: [PATCH 02/43] Bug 926693 - Add B2G support to marionette's mach command, r=ahal --- testing/marionette/mach_commands.py | 150 +++++++++++++++++----------- 1 file changed, 94 insertions(+), 56 deletions(-) diff --git a/testing/marionette/mach_commands.py b/testing/marionette/mach_commands.py index 8ff676229870..71c3c5c7d1bb 100644 --- a/testing/marionette/mach_commands.py +++ b/testing/marionette/mach_commands.py @@ -5,7 +5,10 @@ from __future__ import unicode_literals import os -from mozbuild.base import MachCommandBase +from mozbuild.base import ( + MachCommandBase, + MachCommandConditions as conditions, +) from mach.decorators import ( CommandArgument, @@ -13,69 +16,104 @@ from mach.decorators import ( Command, ) +MARIONETTE_DISABLED = ''' +The %s command requires a Marionette-enabled build. + +Add 'ENABLE_MARIONETTE=1' to your mozconfig file and re-build the application. +Your currently active mozconfig is %s. +'''.lstrip() + +MARIONETTE_DISABLED_B2G = ''' +The %s command requires a Marionette-enabled build. + +Please create an engineering build, which has Marionette enabled. You can do +this by ommitting the VARIANT variable when building, or using: + +VARIANT=eng ./build.sh +''' + +def run_marionette(tests, b2g_path=None, emulator=None, testtype=None, + address=None, bin=None, topsrcdir=None): + from marionette.runtests import ( + MarionetteTestRunner, + MarionetteTestOptions, + startTestRunner + ) + + parser = MarionetteTestOptions() + options, args = parser.parse_args() + + if not tests: + tests = [os.path.join(topsrcdir, + 'testing/marionette/client/marionette/tests/unit-tests.ini')] + + options.type = testtype + if b2g_path: + options.homedir = b2g_path + if emulator: + options.emulator = emulator + else: + options.bin = bin + path, exe = os.path.split(options.bin) + if 'b2g' in exe: + options.app = 'b2gdesktop' + + options.address = address + + parser.verify_usage(options, tests) + + runner = startTestRunner(MarionetteTestRunner, options, tests) + if runner.failed > 0: + return 1 + + return 0 + +@CommandProvider +class B2GCommands(MachCommandBase): + def __init__(self, context): + MachCommandBase.__init__(self, context) + + for attr in ('b2g_home', 'device_name'): + setattr(self, attr, getattr(context, attr, None)) + @Command('marionette-webapi', category='testing', + description='Run a Marionette webapi test', + conditions=[conditions.is_b2g]) + @CommandArgument('--emulator', choices=['x86', 'arm'], + help='Run an emulator of the specified architecture.') + @CommandArgument('--type', dest='testtype', + help='Test type, usually one of: browser, b2g, b2g-qemu.', + default='b2g') + @CommandArgument('tests', nargs='*', metavar='TESTS', + help='Path to test(s) to run.') + def run_marionette_webapi(self, tests, emulator=None, testtype=None): + if not emulator and self.device_name in ('emulator', 'emulator-jb'): + emulator='arm' + + if self.substs.get('ENABLE_MARIONETTE') != '1': + print(MARIONETTE_DISABLED_B2G % 'marionette-webapi') + return 1 + + return run_marionette(tests, b2g_path=self.b2g_home, emulator=emulator, + testtype=testtype, topsrcdir=self.topsrcdir, address=None) + @CommandProvider class MachCommands(MachCommandBase): @Command('marionette-test', category='testing', - description='Run a Marionette test.') - @CommandArgument('--homedir', dest='b2g_path', - help='For B2G testing, the path to the B2G repo.') - @CommandArgument('--emulator', choices=['x86', 'arm'], - help='Run an emulator of the specified architecture.') + description='Run a Marionette test.', + conditions=[conditions.is_firefox]) @CommandArgument('--address', help='host:port of running Gecko instance to connect to.') @CommandArgument('--type', dest='testtype', - help='Test type, usually one of: browser, b2g, b2g-qemu.') + help='Test type, usually one of: browser, b2g, b2g-qemu.', + default='browser') @CommandArgument('tests', nargs='*', metavar='TESTS', help='Path to test(s) to run.') - def run_marionette(self, tests, emulator=None, address=None, b2g_path=None, - testtype=None): - from marionette.runtests import ( - MarionetteTestRunner, - MarionetteTestOptions, - startTestRunner - ) - - parser = MarionetteTestOptions() - options, args = parser.parse_args() - - if not tests: - tests = ['testing/marionette/client/marionette/tests/unit-tests.ini'] - - options.type = testtype - if emulator: - if b2g_path: - options.homedir = b2g_path - if not testtype: - options.type = "b2g" - else: - if not testtype: - options.type = "browser" - try: - bin = self.get_binary_path('app') - options.bin = bin - except Exception as e: - print("It looks like your program isn't built.", - "You can run |mach build| to build it.") - print(e) - return 1 - path, exe = os.path.split(options.bin) - if 'b2g' in exe: - options.app = 'b2gdesktop' - - if not emulator: - if self.substs.get('ENABLE_MARIONETTE') != '1': - print("Marionette doesn't appear to be enabled; please " - "add ENABLE_MARIONETTE=1 to your mozconfig and " - "perform a clobber build.") - return 1 - - options.address = address - - parser.verify_usage(options, tests) - - runner = startTestRunner(MarionetteTestRunner, options, tests) - if runner.failed > 0: + def run_marionette_test(self, tests, address=None, testtype=None): + if self.substs.get('ENABLE_MARIONETTE') != '1': + print(MARIONETTE_DISABLED % ('marionette-test', + self.mozconfig['path'])) return 1 - return 0 + return run_marionette(tests, bin=bin, testtype=testtype, + topsrcdir=self.topsrcdir, address=address) From 000699ecd866a0116c3c37cadff4a1a0c78b0a18 Mon Sep 17 00:00:00 2001 From: Steve Workman Date: Tue, 15 Oct 2013 16:33:11 -0700 Subject: [PATCH 03/43] Bug 924967 - Dispatch nsIRequest::Cancel to main thread in imgRequest::Cancel r=seth --- image/src/imgRequest.cpp | 40 +++++++++++++++++++++++++++++++++++----- image/src/imgRequest.h | 3 +++ 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/image/src/imgRequest.cpp b/image/src/imgRequest.cpp index 71e8a568e31a..67529d330fd1 100644 --- a/image/src/imgRequest.cpp +++ b/image/src/imgRequest.cpp @@ -245,6 +245,28 @@ void imgRequest::CancelAndAbort(nsresult aStatus) } } +class imgRequestMainThreadCancel : public nsRunnable +{ +public: + imgRequestMainThreadCancel(imgRequest *aImgRequest, nsresult aStatus) + : mImgRequest(aImgRequest) + , mStatus(aStatus) + { + MOZ_ASSERT(!NS_IsMainThread(), "Create me off main thread only!"); + MOZ_ASSERT(aImgRequest); + } + + NS_IMETHOD Run() + { + MOZ_ASSERT(NS_IsMainThread(), "I should be running on the main thread!"); + mImgRequest->ContinueCancel(mStatus); + return NS_OK; + } +private: + nsRefPtr mImgRequest; + nsresult mStatus; +}; + void imgRequest::Cancel(nsresult aStatus) { /* The Cancel() method here should only be called by this class. */ @@ -258,14 +280,22 @@ void imgRequest::Cancel(nsresult aStatus) statusTracker->RecordCancel(); if (NS_IsMainThread()) { - RemoveFromCache(); + ContinueCancel(aStatus); } else { - NS_DispatchToMainThread( - NS_NewRunnableMethod(this, &imgRequest::RemoveFromCache)); + NS_DispatchToMainThread(new imgRequestMainThreadCancel(this, aStatus)); } +} - if (mRequest && statusTracker->IsLoading()) - mRequest->Cancel(aStatus); +void imgRequest::ContinueCancel(nsresult aStatus) +{ + MOZ_ASSERT(NS_IsMainThread()); + + RemoveFromCache(); + + nsRefPtr statusTracker = GetStatusTracker(); + if (mRequest && statusTracker->IsLoading()) { + mRequest->Cancel(aStatus); + } } nsresult imgRequest::GetURI(ImageURL **aURI) diff --git a/image/src/imgRequest.h b/image/src/imgRequest.h index c66e1ecbf509..e768507162c1 100644 --- a/image/src/imgRequest.h +++ b/image/src/imgRequest.h @@ -72,6 +72,9 @@ public: // won't be sufficient. void CancelAndAbort(nsresult aStatus); + // Called or dispatched by cancel for main thread only execution. + void ContinueCancel(nsresult aStatus); + // Methods that get forwarded to the Image, or deferred until it's // instantiated. nsresult LockImage(); From 3e03c7c499c3542ba44a360d91458edddce6708f Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Wed, 16 Oct 2013 08:31:18 +0900 Subject: [PATCH 04/43] Bug 926900 - Remove msys-make specific mozconfig. r=gps --- b2g/config/mozconfigs/win32_gecko/nightly | 4 ---- browser/config/mozconfigs/win32/common-opt | 4 ---- browser/config/mozconfigs/win32/debug | 4 ---- browser/config/mozconfigs/win64/common-opt | 4 ---- browser/config/mozconfigs/win64/debug | 4 ---- build/mozconfig.vs2010-common | 6 +----- client.mk | 2 +- xulrunner/config/mozconfigs/win32/xulrunner | 4 ---- xulrunner/config/mozconfigs/win64/xulrunner | 4 ---- 9 files changed, 2 insertions(+), 34 deletions(-) diff --git a/b2g/config/mozconfigs/win32_gecko/nightly b/b2g/config/mozconfigs/win32_gecko/nightly index bb6510f3059e..3f74c94ebc81 100644 --- a/b2g/config/mozconfigs/win32_gecko/nightly +++ b/b2g/config/mozconfigs/win32_gecko/nightly @@ -13,10 +13,6 @@ export MOZILLA_OFFICIAL=1 export MOZ_TELEMETRY_REPORTING=1 -if test -z "${_PYMAKE}"; then - mk_add_options MOZ_MAKE_FLAGS=-j1 -fi - if test "$PROCESSOR_ARCHITECTURE" = "AMD64" -o "$PROCESSOR_ARCHITEW6432" = "AMD64"; then . $topsrcdir/build/win32/mozconfig.vs2010-win64 else diff --git a/browser/config/mozconfigs/win32/common-opt b/browser/config/mozconfigs/win32/common-opt index e1684a8aae1c..94c5fcf92a27 100644 --- a/browser/config/mozconfigs/win32/common-opt +++ b/browser/config/mozconfigs/win32/common-opt @@ -18,10 +18,6 @@ export MOZILLA_OFFICIAL=1 export MOZ_TELEMETRY_REPORTING=1 -if test -z "${_PYMAKE}"; then - mk_add_options MOZ_MAKE_FLAGS=-j1 -fi - if test "$PROCESSOR_ARCHITECTURE" = "AMD64" -o "$PROCESSOR_ARCHITEW6432" = "AMD64"; then . $topsrcdir/build/win32/mozconfig.vs2010-win64 else diff --git a/browser/config/mozconfigs/win32/debug b/browser/config/mozconfigs/win32/debug index ad878ede5d2b..8427117e9cb5 100644 --- a/browser/config/mozconfigs/win32/debug +++ b/browser/config/mozconfigs/win32/debug @@ -8,10 +8,6 @@ ac_add_options --enable-metro # Needed to enable breakpad in application.ini export MOZILLA_OFFICIAL=1 -if test -z "${_PYMAKE}"; then - mk_add_options MOZ_MAKE_FLAGS=-j1 -fi - if test "$PROCESSOR_ARCHITECTURE" = "AMD64" -o "$PROCESSOR_ARCHITEW6432" = "AMD64"; then . $topsrcdir/build/win32/mozconfig.vs2010-win64 else diff --git a/browser/config/mozconfigs/win64/common-opt b/browser/config/mozconfigs/win64/common-opt index d81e366f4999..9afb969c3e58 100644 --- a/browser/config/mozconfigs/win64/common-opt +++ b/browser/config/mozconfigs/win64/common-opt @@ -17,9 +17,5 @@ export MOZILLA_OFFICIAL=1 export MOZ_TELEMETRY_REPORTING=1 -if test -z "${_PYMAKE}"; then - mk_add_options MOZ_MAKE_FLAGS=-j1 -fi - # Package js shell. export MOZ_PACKAGE_JSSHELL=1 diff --git a/browser/config/mozconfigs/win64/debug b/browser/config/mozconfigs/win64/debug index a907b9e9037a..aff6627fe6ee 100644 --- a/browser/config/mozconfigs/win64/debug +++ b/browser/config/mozconfigs/win64/debug @@ -11,10 +11,6 @@ ac_add_options --enable-metro # Needed to enable breakpad in application.ini export MOZILLA_OFFICIAL=1 -if test -z "${_PYMAKE}"; then - mk_add_options MOZ_MAKE_FLAGS=-j1 -fi - # Package js shell. export MOZ_PACKAGE_JSSHELL=1 diff --git a/build/mozconfig.vs2010-common b/build/mozconfig.vs2010-common index 9806ae24282b..ca5df2f3aa2b 100644 --- a/build/mozconfig.vs2010-common +++ b/build/mozconfig.vs2010-common @@ -1,8 +1,4 @@ # Pymake needs Windows-style paths. Use cmd.exe to hack around this. mk_export_correct_style() { - if test -n "${_PYMAKE}"; then - mk_add_options "export $1=$(cmd.exe //c echo %$1%)" - else - mk_add_options "export $1=$(eval echo \$$1)" - fi + mk_add_options "export $1=$(cmd.exe //c echo %$1%)" } diff --git a/client.mk b/client.mk index 3723b2ee3e71..96958b61ab50 100644 --- a/client.mk +++ b/client.mk @@ -117,7 +117,7 @@ endef # before evaluation. $(shell) replacing newlines with spaces, || is always # followed by a space (since sed doesn't remove newlines), except on the # last line, so replace both '|| ' and '||'. -MOZCONFIG_CONTENT := $(subst ||,$(CR),$(subst || ,$(CR),$(shell _PYMAKE=$(.PYMAKE) $(TOPSRCDIR)/$(MOZCONFIG_LOADER) $(TOPSRCDIR) | sed 's/$$/||/'))) +MOZCONFIG_CONTENT := $(subst ||,$(CR),$(subst || ,$(CR),$(shell $(TOPSRCDIR)/$(MOZCONFIG_LOADER) $(TOPSRCDIR) | sed 's/$$/||/'))) $(eval $(MOZCONFIG_CONTENT)) export FOUND_MOZCONFIG diff --git a/xulrunner/config/mozconfigs/win32/xulrunner b/xulrunner/config/mozconfigs/win32/xulrunner index 17b0cbbc2b2a..b49f37213ff3 100644 --- a/xulrunner/config/mozconfigs/win32/xulrunner +++ b/xulrunner/config/mozconfigs/win32/xulrunner @@ -7,10 +7,6 @@ ac_add_options --enable-application=xulrunner ac_add_options --enable-jemalloc ac_add_options --disable-tests -if test -z "${_PYMAKE}"; then - mk_add_options MOZ_MAKE_FLAGS=-j1 -fi - if test "$PROCESSOR_ARCHITECTURE" = "AMD64" -o "$PROCESSOR_ARCHITEW6432" = "AMD64"; then . $topsrcdir/build/win32/mozconfig.vs2010-win64 else diff --git a/xulrunner/config/mozconfigs/win64/xulrunner b/xulrunner/config/mozconfigs/win64/xulrunner index 30dffb38265c..d2a4a740a187 100644 --- a/xulrunner/config/mozconfigs/win64/xulrunner +++ b/xulrunner/config/mozconfigs/win64/xulrunner @@ -10,8 +10,4 @@ ac_add_options --enable-application=xulrunner ac_add_options --enable-jemalloc ac_add_options --disable-tests -if test -z "${_PYMAKE}"; then - mk_add_options MOZ_MAKE_FLAGS=-j1 -fi - . "$topsrcdir/xulrunner/config/mozconfigs/common.override" From 616f4b2735630e90ba3934157606bd39cb5fe08c Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Wed, 16 Oct 2013 08:34:18 +0900 Subject: [PATCH 05/43] Bug 925605 - Allow to build with a special build of GNU make on windows. r=gps --- client.mk | 7 ------- config/baseconfig.mk | 15 +++++++-------- config/rules.mk | 4 ++-- js/src/config/baseconfig.mk | 15 +++++++-------- js/src/config/rules.mk | 4 ++-- js/src/configure.in | 4 ++++ python/mozbuild/mozbuild/base.py | 7 +++++++ security/build/Makefile.in | 20 ++++++++++++++------ 8 files changed, 43 insertions(+), 33 deletions(-) diff --git a/client.mk b/client.mk index 96958b61ab50..4b50c43e7f9f 100644 --- a/client.mk +++ b/client.mk @@ -85,13 +85,6 @@ endif # Windows checks. ifneq (,$(findstring mingw,$(CONFIG_GUESS))) -# Require pymake (as opposed to GNU make). -ifndef .PYMAKE -$(error Pymake is required to build on Windows. Run |./mach build| to \ -automatically use pymake. Or, invoke pymake directly via \ -|python build/pymake/make.py|.) -endif - # check for CRLF line endings ifneq (0,$(shell $(PERL) -e 'binmode(STDIN); while () { if (/\r/) { print "1"; exit } } print "0"' < $(TOPSRCDIR)/client.mk)) $(error This source tree appears to have Windows-style line endings. To \ diff --git a/config/baseconfig.mk b/config/baseconfig.mk index 50f4cd4a7dd1..b5aebf926fa5 100644 --- a/config/baseconfig.mk +++ b/config/baseconfig.mk @@ -9,16 +9,15 @@ DIST = $(DEPTH)/dist _OBJ_SUFFIX := $(OBJ_SUFFIX) OBJ_SUFFIX = $(error config/config.mk needs to be included before using OBJ_SUFFIX) -# We only want to do the pymake sanity on Windows, other os's can cope ifeq ($(HOST_OS_ARCH),WINNT) -# Ensure invariants between GNU Make and pymake -# Checked here since we want the sane error in a file that -# actually can be found regardless of path-style. -ifeq (_:,$(.PYMAKE)_$(findstring :,$(srcdir))) -$(error Windows-style srcdir being used with GNU make. Did you mean to run $(topsrcdir)/build/pymake/make.py instead? [see-also: https://developer.mozilla.org/en/Gmake_vs._Pymake]) +# We only support building with pymake or a specially built gnu make. +ifndef .PYMAKE +ifeq (,$(filter mozmake%,$(notdir $(MAKE)))) +$(error Only building with pymake or mozmake is supported.) endif -ifeq (1_a,$(.PYMAKE)_$(firstword a$(subst /, ,$(srcdir)))) -$(error MSYS-style srcdir being used with Pymake. Did you mean to run GNU Make instead? [see-also: https://developer.mozilla.org/ en/Gmake_vs._Pymake]) +endif +ifeq (a,$(firstword a$(subst /, ,$(srcdir)))) +$(error MSYS-style srcdir are not supported for Windows builds.) endif endif # WINNT diff --git a/config/rules.mk b/config/rules.mk index a5ad85c1972c..ef332bcca305 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -220,13 +220,13 @@ endif # CPP_UNIT_TESTS ifdef PYTHON_UNIT_TESTS -RUN_PYTHON_UNIT_TESTS := $(addprefix run-,$(PYTHON_UNIT_TESTS)) +RUN_PYTHON_UNIT_TESTS := $(addsuffix -run,$(PYTHON_UNIT_TESTS)) .PHONY: $(RUN_PYTHON_UNIT_TESTS) check:: $(RUN_PYTHON_UNIT_TESTS) -$(RUN_PYTHON_UNIT_TESTS): run-%: % +$(RUN_PYTHON_UNIT_TESTS): %-run: % @PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $< endif # PYTHON_UNIT_TESTS diff --git a/js/src/config/baseconfig.mk b/js/src/config/baseconfig.mk index 107c5e06e9b3..c80ec999adf2 100644 --- a/js/src/config/baseconfig.mk +++ b/js/src/config/baseconfig.mk @@ -16,16 +16,15 @@ endif _OBJ_SUFFIX := $(OBJ_SUFFIX) OBJ_SUFFIX = $(error config/config.mk needs to be included before using OBJ_SUFFIX) -# We only want to do the pymake sanity on Windows, other os's can cope ifeq ($(HOST_OS_ARCH),WINNT) -# Ensure invariants between GNU Make and pymake -# Checked here since we want the sane error in a file that -# actually can be found regardless of path-style. -ifeq (_:,$(.PYMAKE)_$(findstring :,$(srcdir))) -$(error Windows-style srcdir being used with GNU make. Did you mean to run $(topsrcdir)/build/pymake/make.py instead? [see-also: https://developer.mozilla.org/en/Gmake_vs._Pymake]) +# We only support building with pymake or a specially built gnu make. +ifndef .PYMAKE +ifeq (,$(filter mozmake%,$(notdir $(MAKE)))) +$(error Only building with pymake or mozmake is supported.) endif -ifeq (1_a,$(.PYMAKE)_$(firstword a$(subst /, ,$(srcdir)))) -$(error MSYS-style srcdir being used with Pymake. Did you mean to run GNU Make instead? [see-also: https://developer.mozilla.org/ en/Gmake_vs._Pymake]) +endif +ifeq (a,$(firstword a$(subst /, ,$(srcdir)))) +$(error MSYS-style srcdir are not supported for Windows builds.) endif endif # WINNT diff --git a/js/src/config/rules.mk b/js/src/config/rules.mk index a5ad85c1972c..ef332bcca305 100644 --- a/js/src/config/rules.mk +++ b/js/src/config/rules.mk @@ -220,13 +220,13 @@ endif # CPP_UNIT_TESTS ifdef PYTHON_UNIT_TESTS -RUN_PYTHON_UNIT_TESTS := $(addprefix run-,$(PYTHON_UNIT_TESTS)) +RUN_PYTHON_UNIT_TESTS := $(addsuffix -run,$(PYTHON_UNIT_TESTS)) .PHONY: $(RUN_PYTHON_UNIT_TESTS) check:: $(RUN_PYTHON_UNIT_TESTS) -$(RUN_PYTHON_UNIT_TESTS): run-%: % +$(RUN_PYTHON_UNIT_TESTS): %-run: % @PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $< endif # PYTHON_UNIT_TESTS diff --git a/js/src/configure.in b/js/src/configure.in index 2157cfdbd06c..03e05d911ff2 100644 --- a/js/src/configure.in +++ b/js/src/configure.in @@ -4197,6 +4197,7 @@ if test -n "$ENABLE_INTL_API" -a -z "$MOZ_NATIVE_ICU"; then ICU_CPPFLAGS="$ICU_CPPFLAGS -DUCONFIG_NO_REGULAR_EXPRESSIONS" ICU_CPPFLAGS="$ICU_CPPFLAGS -DUCONFIG_NO_BREAK_ITERATION" + ICU_SRCDIR="" # Set OS dependent options for ICU case "$OS_TARGET" in Darwin) @@ -4207,6 +4208,7 @@ if test -n "$ENABLE_INTL_API" -a -z "$MOZ_NATIVE_ICU"; then ;; WINNT) ICU_TARGET=MSYS/MSVC + ICU_SRCDIR="--srcdir=$(cd $srcdir/../../intl/icu/source; pwd -W)" ;; DragonFly|FreeBSD|NetBSD|OpenBSD) ICU_TARGET=BSD @@ -4240,6 +4242,8 @@ if test -n "$ENABLE_INTL_API" -a -z "$MOZ_NATIVE_ICU"; then $ICU_BUILD_OPTS \ $ICU_TARGET \ $ICU_LINK_OPTS \ +dnl Shell quoting is fun. + ${ICU_SRCDIR+"$ICU_SRCDIR"} \ --enable-extras=no --enable-icuio=no --enable-layout=no \ --enable-tests=no --enable-samples=no || exit 1 ]) diff --git a/python/mozbuild/mozbuild/base.py b/python/mozbuild/mozbuild/base.py index 96568f548e50..974d702cfd0b 100644 --- a/python/mozbuild/mozbuild/base.py +++ b/python/mozbuild/mozbuild/base.py @@ -458,6 +458,13 @@ class MozbuildObject(ProcessExecutionMixin): return fn(**params) def _make_path(self, force_pymake=False): + if self._is_windows() and not force_pymake: + # Use mozmake if it's available. + try: + return [which.which('mozmake')] + except which.WhichError: + pass + if self._is_windows() or force_pymake: make_py = os.path.join(self.topsrcdir, 'build', 'pymake', 'make.py').replace(os.sep, '/') diff --git a/security/build/Makefile.in b/security/build/Makefile.in index 4874f7146836..7a53ff0fcabf 100644 --- a/security/build/Makefile.in +++ b/security/build/Makefile.in @@ -129,9 +129,15 @@ DEFAULT_GMAKE_FLAGS += NSPR_LIB_DIR=$(NSPR_LIB_DIR) DEFAULT_GMAKE_FLAGS += MOZILLA_CLIENT=1 DEFAULT_GMAKE_FLAGS += NO_MDUPDATE=1 DEFAULT_GMAKE_FLAGS += NSS_ENABLE_ECC=1 -DEFAULT_GMAKE_FLAGS += NSINSTALL="$(NSINSTALL)" +ifeq ($(NSINSTALL_PY),$(NSINSTALL)) +DEFAULT_GMAKE_FLAGS += PYTHON='$(PYTHON)' +DEFAULT_GMAKE_FLAGS += NSINSTALL_PY='$(call core_abspath,$(topsrcdir)/config/nsinstall.py)' +DEFAULT_GMAKE_FLAGS += NSINSTALL='$$(PYTHON) $$(NSINSTALL_PY)' +else +DEFAULT_GMAKE_FLAGS += NSINSTALL='$(NSINSTALL)' +endif ifeq ($(OS_ARCH),WINNT) -DEFAULT_GMAKE_FLAGS += INSTALL="$(NSINSTALL) -t" +DEFAULT_GMAKE_FLAGS += INSTALL='$$(NSINSTALL) -t' endif ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_1) DEFAULT_GMAKE_FLAGS += OS_DLLFLAGS="-static-libgcc" @@ -147,14 +153,16 @@ endif ifdef NSS_DISABLE_DBM DEFAULT_GMAKE_FLAGS += NSS_DISABLE_DBM=1 endif -ABS_topsrcdir := $(shell cd $(topsrcdir); pwd) ifeq ($(HOST_OS_ARCH),WINNT) -ifdef .PYMAKE ABS_topsrcdir := $(shell cd $(topsrcdir); pwd -W) -endif +else +ABS_topsrcdir := $(shell cd $(topsrcdir); pwd) endif # Hack to force NSS build system to use "normal" object directories -DEFAULT_GMAKE_FLAGS += BUILD='$(MOZ_BUILD_ROOT)/security/$$(subst $(ABS_topsrcdir)/security/,,$$(CURDIR))' +DEFAULT_GMAKE_FLAGS += ABS_topsrcdir='$(ABS_topsrcdir)' +# ABS_topsrcdir can't be expanded here because msys path mangling likes to break +# paths in that case. +DEFAULT_GMAKE_FLAGS += BUILD='$(MOZ_BUILD_ROOT)/security/$$(subst $$(ABS_topsrcdir)/security/,,$$(CURDIR))' DEFAULT_GMAKE_FLAGS += BUILD_TREE='$$(BUILD)' OBJDIR='$$(BUILD)' DEPENDENCIES='$$(BUILD)/.deps' SINGLE_SHLIB_DIR='$$(BUILD)' DEFAULT_GMAKE_FLAGS += SOURCE_XP_DIR=$(ABS_DIST) ifndef MOZ_DEBUG From eb1177dfd1e46c8a9cce82eafa2915f3007204d4 Mon Sep 17 00:00:00 2001 From: Luke Wagner Date: Tue, 15 Oct 2013 12:13:34 -0500 Subject: [PATCH 06/43] Bug 900669 - OdinMonkey: asm.js caching (shell-only support) (r=sstangl) --HG-- extra : rebase_source : c48a7a8cd83a9af6f39884b800a026016353c7c6 --- js/src/builtin/TestingFunctions.cpp | 21 + js/src/frontend/ParseNode.h | 13 + js/src/frontend/Parser.h | 15 + js/src/frontend/TokenStream.h | 17 + js/src/jit-test/jit_test.py | 14 +- js/src/jit-test/lib/asm.js | 24 +- js/src/jit-test/lib/bullet.js | 56007 ++++++++++++++++ js/src/jit-test/tests/asm.js/testBullet.js | 18 + js/src/jit-test/tests/asm.js/testCaching.js | 100 + .../jit-test/tests/asm.js/testX86ByteStore.js | 12 +- js/src/jit/AsmJS.cpp | 33 +- js/src/jit/AsmJSLink.cpp | 30 +- js/src/jit/AsmJSLink.h | 13 + js/src/jit/AsmJSModule.cpp | 631 +- js/src/jit/AsmJSModule.h | 53 +- js/src/jit/Ion.h | 8 + js/src/jit/IonAnalysis.cpp | 4 + js/src/jit/LinearScan.cpp | 6 + js/src/jit/LiveRangeAllocator.h | 3 + js/src/jit/RegisterSets.h | 1 + js/src/jit/arm/Architecture-arm.cpp | 12 +- js/src/jit/arm/Architecture-arm.h | 1 + js/src/jsapi.cpp | 6 + js/src/jsapi.h | 54 + js/src/jscntxt.h | 1 + js/src/jsshell.msg | 2 + js/src/shell/js.cpp | 440 +- js/src/tests/lib/jittests.py | 1 + js/src/vm/Runtime.cpp | 1 + js/src/vm/Runtime.h | 3 + 30 files changed, 57499 insertions(+), 45 deletions(-) create mode 100644 js/src/jit-test/lib/bullet.js create mode 100644 js/src/jit-test/tests/asm.js/testBullet.js create mode 100644 js/src/jit-test/tests/asm.js/testCaching.js diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp index 487e418e82e3..329f8127f964 100644 --- a/js/src/builtin/TestingFunctions.cpp +++ b/js/src/builtin/TestingFunctions.cpp @@ -1082,6 +1082,15 @@ SetJitCompilerOption(JSContext *cx, unsigned argc, jsval *vp) return true; } +static bool +SetIonAssertGraphCoherency(JSContext *cx, unsigned argc, jsval *vp) +{ + CallArgs args = CallArgsFromVp(argc, vp); + jit::js_IonOptions.assertGraphConsistency = ToBoolean(args.get(0)); + args.rval().setUndefined(); + return true; +} + static const JSFunctionSpecWithHelp TestingFunctions[] = { JS_FN_HELP("gc", ::GC, 0, 0, "gc([obj] | 'compartment')", @@ -1246,6 +1255,12 @@ static const JSFunctionSpecWithHelp TestingFunctions[] = { " Returns whether the given value is a function containing \"use asm\" that has been\n" " validated according to the asm.js spec."), + JS_FN_HELP("isAsmJSModuleLoadedFromCache", IsAsmJSModuleLoadedFromCache, 1, 0, +"isAsmJSModule(fn)", +" Return whether the given asm.js module function has been loaded directly\n" +" from the cache. This function throws an error if fn is not a validated asm.js\n" +" module."), + JS_FN_HELP("isAsmJSFunction", IsAsmJSFunction, 1, 0, "isAsmJSFunction(fn)", " Returns whether the given value is a nested function in an asm.js module that has been\n" @@ -1275,6 +1290,12 @@ static const JSFunctionSpecWithHelp TestingFunctions[] = { "setCompilerOption(