merge mozilla-inbound to mozilla-central a=merge

This commit is contained in:
Carsten "Tomcat" Book 2014-11-04 12:53:14 +01:00
commit bca68d29e5
38 changed files with 321 additions and 190 deletions

View File

@ -22,8 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.
<<<<<<< local
Bug 1092813 needs a CLOBBER
=======
Bug 1056337 - Change the default compiler on B2G ICS to gcc 4.8.
>>>>>>> other
Bug 1087560 changed a mochitest manifest without touching its moz.build.

View File

@ -197,6 +197,9 @@ chmod +x $CONFIG_STATUS
define([MOZ_RUN_CONFIG_STATUS],
[
MOZ_RUN_ALL_SUBCONFIGURES()
rm -fr confdefs* $ac_clean_files
dnl Execute config.status, unless --no-create was passed to configure.
if test "$no_create" != yes && ! ${PYTHON} $CONFIG_STATUS; then

View File

@ -16,6 +16,7 @@ define([AC_INIT_PREPARE],
[_MOZ_AC_INIT_PREPARE($1)
MOZ_CONFIG_LOG_TRAP
> subconfigures
> skip_subconfigures
])
define([AC_OUTPUT_SUBDIRS],
@ -53,17 +54,34 @@ define([AC_OUTPUT_SUBDIRS],
eval $dumpenv $PYTHON $_topsrcdir/build/subconfigure.py --prepare "$srcdir" "$moz_config_dir" "$_CONFIG_SHELL" $ac_configure_args ifelse($2,,,--cache-file="$2")
dnl Execute subconfigure, unless --no-recursion was passed to configure.
if test "$no_recursion" != yes; then
trap '' EXIT
if ! $PYTHON $_topsrcdir/build/subconfigure.py "$objdir"; then
exit 1
fi
MOZ_CONFIG_LOG_TRAP
fi
dnl Actual subconfigure execution happens in MOZ_RUN_CONFIG_STATUS
done
])
define([AC_OUTPUT_SUBDIRS_NOW],
[
for moz_config_dir_ in $1; do
AC_OUTPUT_SUBDIRS($moz_config_dir_,$2)
tail -1 subconfigures >> skip_subconfigures
MOZ_RUN_SUBCONFIGURES(`tail -1 skip_subconfigures`)
done
])
define([MOZ_RUN_SUBCONFIGURES],
[dnl Execute subconfigure, unless --no-recursion was passed to configure.
if test "$no_recursion" != yes; then
trap '' EXIT
if ! $PYTHON $_topsrcdir/build/subconfigure.py $1; then
exit 1
fi
MOZ_CONFIG_LOG_TRAP
fi
])
define([MOZ_RUN_ALL_SUBCONFIGURES],
MOZ_RUN_SUBCONFIGURES([--list subconfigures --skip skip_subconfigures])
)
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; }])

View File

@ -180,7 +180,7 @@ if test -z "$BUILDING_JS" -o -n "$JS_STANDALONE"; then
export LDFLAGS="$HOST_LDFLAGS"
ac_configure_args="$HOST_ICU_BUILD_OPTS"
ac_configure_args="$ac_configure_args --enable-static --disable-shared --enable-extras=no --enable-icuio=no --enable-layout=no --enable-tests=no --enable-samples=no"
AC_OUTPUT_SUBDIRS(intl/icu/source:intl/icu/host)
AC_OUTPUT_SUBDIRS_NOW(intl/icu/source:intl/icu/host)
) || exit 1
# generate config/icucross.mk
$GMAKE -C $_objdir/intl/icu/host/ config/icucross.mk

View File

@ -15,6 +15,28 @@ import pickle
import mozpack.path as mozpath
try:
from multiprocessing import Pool, cpu_count
except ImportError:
import itertools
class Pool(object):
def __init__(self, size):
pass
def imap_unordered(self, fn, iterable):
return itertools.imap(fn, iterable)
def close(self):
pass
def join(self):
pass
def cpu_count():
return 1
class File(object):
def __init__(self, path):
self._path = path
@ -70,6 +92,9 @@ PRECIOUS_VARS = set([
])
CONFIGURE_DATA = 'configure.pkl'
# Autoconf, in some of the sub-configures used in the tree, likes to error
# out when "precious" variables change in value. The solution it gives to
# straighten things is to either run make distclean or remove config.cache.
@ -160,7 +185,7 @@ def get_config_files(data):
return config_files, command_files
def prepare(data_file, srcdir, objdir, shell, args):
def prepare(srcdir, objdir, shell, args):
parser = argparse.ArgumentParser()
parser.add_argument('--target', type=str)
parser.add_argument('--host', type=str)
@ -172,7 +197,7 @@ def prepare(data_file, srcdir, objdir, shell, args):
# will take it from the configure path anyways).
parser.add_argument('--srcdir', type=str)
data_file = os.path.join(objdir, data_file)
data_file = os.path.join(objdir, CONFIGURE_DATA)
previous_args = None
if os.path.exists(data_file):
with open(data_file, 'rb') as f:
@ -227,10 +252,15 @@ def prepare(data_file, srcdir, objdir, shell, args):
pickle.dump(data, f)
def run(data_file, objdir):
ret = 0
def prefix_lines(text, prefix):
return ''.join('%s> %s' % (prefix, line) for line in text.splitlines(True))
with open(os.path.join(objdir, data_file), 'rb') as f:
def run(objdir):
ret = 0
output = ''
with open(os.path.join(objdir, CONFIGURE_DATA), 'rb') as f:
data = pickle.load(f)
data['objdir'] = objdir
@ -271,6 +301,8 @@ def run(data_file, objdir):
cleared_cache:
skip_configure = False
relobjdir = os.path.relpath(objdir, os.getcwd())
if not skip_configure:
command = [data['shell'], configure]
for kind in ('target', 'build', 'host'):
@ -283,13 +315,14 @@ def run(data_file, objdir):
# We're going to run it ourselves.
command += ['--no-create']
print 'configuring in %s' % os.path.relpath(objdir, os.getcwd())
print 'running %s' % ' '.join(command[:-1])
print prefix_lines('configuring', relobjdir)
print prefix_lines('running %s' % ' '.join(command[:-1]), relobjdir)
sys.stdout.flush()
ret = subprocess.call(command, cwd=objdir, env=data['env'])
if ret:
return ret
try:
output += subprocess.check_output(command,
stderr=subprocess.STDOUT, cwd=objdir, env=data['env'])
except subprocess.CalledProcessError as e:
return relobjdir, e.returncode, e.output
# Leave config.status with a new timestamp if configure is newer than
# its original mtime.
@ -317,25 +350,61 @@ def run(data_file, objdir):
if not skip_config_status:
if skip_configure:
print 'running config.status in %s' % os.path.relpath(objdir,
os.getcwd())
print prefix_lines('running config.status', relobjdir)
sys.stdout.flush()
ret = subprocess.call([data['shell'], '-c', './config.status'],
cwd=objdir, env=data['env'])
try:
output += subprocess.check_output([data['shell'], '-c',
'./config.status'], stderr=subprocess.STDOUT, cwd=objdir,
env=data['env'])
except subprocess.CalledProcessError as e:
ret = e.returncode
output += e.output
for f in contents:
f.update_time()
return relobjdir, ret, output
def subconfigure(args):
parser = argparse.ArgumentParser()
parser.add_argument('--list', type=str,
help='File containing a list of subconfigures to run')
parser.add_argument('--skip', type=str,
help='File containing a list of Subconfigures to skip')
parser.add_argument('subconfigures', type=str, nargs='*',
help='Subconfigures to run if no list file is given')
args, others = parser.parse_known_args(args)
subconfigures = args.subconfigures
if args.list:
subconfigures.extend(open(args.list, 'rb').read().splitlines())
if args.skip:
skips = set(open(args.skip, 'rb').read().splitlines())
subconfigures = [s for s in subconfigures if s not in skips]
if not subconfigures:
return 0
ret = 0
# One would think using a ThreadPool would be faster, considering
# everything happens in subprocesses anyways, but no, it's actually
# slower on Windows. (20s difference overall!)
pool = Pool(min(len(subconfigures), cpu_count()))
for relobjdir, returncode, output in \
pool.imap_unordered(run, subconfigures):
print prefix_lines(output, relobjdir)
sys.stdout.flush()
ret = max(returncode, ret)
if ret:
break
pool.close()
pool.join()
return ret
CONFIGURE_DATA = 'configure.pkl'
def main(args):
if args[0] != '--prepare':
if len(args) != 1:
raise Exception('Usage: %s relativeobjdir' % __file__)
return run(CONFIGURE_DATA, args[0])
return subconfigure(args)
topsrcdir = os.path.abspath(args[1])
subdir = args[2]
@ -347,7 +416,7 @@ def main(args):
srcdir = os.path.join(topsrcdir, srcdir)
objdir = os.path.abspath(subdir)
return prepare(CONFIGURE_DATA, srcdir, objdir, args[3], args[4:])
return prepare(srcdir, objdir, args[3], args[4:])
if __name__ == '__main__':

View File

@ -245,13 +245,6 @@ endif
#
_ENABLE_PIC=1
# PGO on MSVC is opt-in
ifdef _MSC_VER
ifndef MSVC_ENABLE_PGO
NO_PROFILE_GUIDED_OPTIMIZE = 1
endif
endif
# No sense in profiling tools
ifdef INTERNAL_TOOLS
NO_PROFILE_GUIDED_OPTIMIZE = 1
@ -289,10 +282,6 @@ endif
endif # MOZ_PROFILE_USE
endif # NO_PROFILE_GUIDED_OPTIMIZE
ifdef _MSC_VER
OS_LDFLAGS += $(DELAYLOAD_LDFLAGS)
endif # _MSC_VER
MAKE_JARS_FLAGS = \
-t $(topsrcdir) \
-f $(MOZ_CHROME_FILE_FORMAT) \
@ -702,24 +691,6 @@ endif
endif
endif
# EXPAND_LIBNAME - $(call EXPAND_LIBNAME,foo)
# expands to $(LIB_PREFIX)foo.$(LIB_SUFFIX) or -lfoo, depending on linker
# arguments syntax. Should only be used for system libraries
# EXPAND_LIBNAME_PATH - $(call EXPAND_LIBNAME_PATH,foo,dir)
# expands to dir/$(LIB_PREFIX)foo.$(LIB_SUFFIX)
# EXPAND_MOZLIBNAME - $(call EXPAND_MOZLIBNAME,foo)
# expands to $(DIST)/lib/$(LIB_PREFIX)foo.$(LIB_SUFFIX)
ifdef GNU_CC
EXPAND_LIBNAME = $(addprefix -l,$(1))
else
EXPAND_LIBNAME = $(foreach lib,$(1),$(LIB_PREFIX)$(lib).$(LIB_SUFFIX))
endif
EXPAND_LIBNAME_PATH = $(foreach lib,$(1),$(2)/$(LIB_PREFIX)$(lib).$(LIB_SUFFIX))
EXPAND_MOZLIBNAME = $(foreach lib,$(1),$(DIST)/lib/$(LIB_PREFIX)$(lib).$(LIB_SUFFIX))
PLY_INCLUDE = -I$(topsrcdir)/other-licenses/ply
export CL_INCLUDES_PREFIX

View File

@ -479,12 +479,6 @@ ifeq ($(OS_ARCH),GNU)
OS_CPPFLAGS += -DPATH_MAX=1024 -DMAXPATHLEN=1024
endif
ifeq ($(OS_ARCH),WINNT)
ifdef USE_DELAYIMP
OS_LIBS += $(call EXPAND_LIBNAME,delayimp)
endif
endif
#
# MINGW32
#

View File

@ -9240,7 +9240,7 @@ if test -n "$_subconfigure_subdir"; then
srcdir="$srcdir/.."
_save_ac_configure_args="$ac_configure_args"
ac_configure_args="$_subconfigure_config_args"
AC_OUTPUT_SUBDIRS("$_subconfigure_subdir",$cache_file)
AC_OUTPUT_SUBDIRS_NOW("$_subconfigure_subdir",$cache_file)
ac_configure_args="$_save_ac_configure_args"
srcdir="$_save_srcdir"
fi

View File

@ -160,6 +160,7 @@ GK_ATOM(browser, "browser")
GK_ATOM(mozbrowser, "mozbrowser")
GK_ATOM(bulletinboard, "bulletinboard")
GK_ATOM(button, "button")
GK_ATOM(brighttitlebarforeground, "brighttitlebarforeground")
GK_ATOM(callTemplate, "call-template")
GK_ATOM(cancel, "cancel")
GK_ATOM(canvas, "canvas")

View File

@ -1,14 +1,18 @@
[DEFAULT]
skip-if = ((os == 'linux') && (buildapp == 'b2g'))
support-files =
webgl-mochitest/driver-info.js
webgl-mochitest/webgl-util.js
[webgl-mochitest/test-backbuffer-channels.html]
[webgl-mochitest/test-hidden-alpha.html]
[webgl-mochitest/test_backbuffer_channels.html]
fail-if = (os == 'b2g')
[webgl-mochitest/test_depth_readpixels.html]
[webgl-mochitest/test_draw.html]
[webgl-mochitest/test_fb_param.html]
[webgl-mochitest/test_fb_param_crash.html]
[webgl-mochitest/test_hidden_alpha.html]
fail-if = (os == 'b2g')
[webgl-mochitest/test_highp_fs.html]
[webgl-mochitest/test_no_arr_points.html]
skip-if = android_version == '10' #Android 2.3 aws only; bug 1030942

View File

@ -48,6 +48,11 @@ function todo(val, text) {
: 'Test <font color=\\'blue\\' >todo</font>: ';
debug(status + text);
}
SimpleTest = {
waitForExplicitFinish: function() {},
finish: function() {},
};
</script>
<div id='mochi-to-testcase-output'></div>
\n'''

View File

@ -8,7 +8,7 @@
<script>
function TestAttribs(attribs) {
debug('Testing attribs: ' + JSON.stringify(attribs));
ok(true, 'Testing attribs: ' + JSON.stringify(attribs));
var canvas = document.createElement('canvas');
var gl = canvas.getContext('experimental-webgl', attribs);
ok(gl, 'No tested attribs should result in failure to create a context');

View File

@ -77,7 +77,7 @@ function Test(gl, prog) {
//////////////////
debug('clear(R,G,B,0)');
ok(true, 'clear(R,G,B,0)');
Reset(gl);
@ -102,7 +102,7 @@ function Test(gl, prog) {
//////////////////
debug('mask(R,G,B,0), clear(R,G,B,1)');
ok(true, 'mask(R,G,B,0), clear(R,G,B,1)');
Reset(gl);
@ -129,6 +129,7 @@ function Test(gl, prog) {
'toDataURL should be unchanged after blending.');
ok(true, 'Test complete.');
SimpleTest.finish();
}
(function(){
@ -146,6 +147,7 @@ function Test(gl, prog) {
ok(prog, 'Program should link.');
prog.aPosCoord = gl.getAttribLocation(prog, 'aPosCoord');
SimpleTest.waitForExplicitFinish();
setTimeout(function(){ Test(gl, prog); }, 500);
})();

View File

@ -10,7 +10,7 @@ support-files =
[conformancetest/test_event.html]
[conformancetest/test_runtest.html]
skip-if = (toolkit == 'android') || (buildapp == 'b2g') #b2g(takes too long) b2g-debug(takes too long) b2g-desktop(takes too long)
skip-if = (toolkit == 'android') || (buildapp == 'b2g') || e10s #b2g(takes too long) b2g-debug(takes too long) b2g-desktop(takes too long)
[selecttest/test_Document-open.html]
[selecttest/test_addRange.html]
skip-if = (toolkit == 'android') || (buildapp == 'b2g') #android(bug 775227) b2g(oom?, bug 775227) b2g-debug(oom?, bug 775227) b2g-desktop(oom?, bug 775227)

View File

@ -40,13 +40,19 @@ UNIFIED_SOURCES += [
'ipc/MobileConnectionParent.cpp',
'MobileCallForwardingOptions.cpp',
'MobileCellInfo.cpp',
'MobileConnection.cpp',
'MobileConnectionArray.cpp',
'MobileConnectionCallback.cpp',
'MobileConnectionInfo.cpp',
'MobileNetworkInfo.cpp',
]
SOURCES += [
'MobileConnection.cpp', # Non-unified due to no_pgo
]
if CONFIG['_MSC_VER'] and CONFIG['CPU_ARCH'] == 'x86_64':
SOURCES['MobileConnection.cpp'].no_pgo = True # VS2013 crashes, bug 1084162
IPDL_SOURCES += [
'ipc/PMobileConnection.ipdl',
'ipc/PMobileConnectionRequest.ipdl',

View File

@ -2368,6 +2368,13 @@ nsPluginHost::FindPluginsForContent(uint32_t aPluginEpoch,
for (size_t i = 0; i < plugins.Length(); i++) {
nsRefPtr<nsPluginTag> tag = plugins[i];
if (!nsNPAPIPlugin::RunPluginOOP(tag)) {
// Don't expose non-OOP plugins to content processes since we have no way
// to bridge them over.
continue;
}
aPlugins->AppendElement(PluginTag(tag->mId,
tag->mName,
tag->mDescription,

View File

@ -1159,8 +1159,12 @@ nsXULElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
nsCOMPtr<nsIXULDocument> xuldoc = do_QueryInterface(document);
if (xuldoc) {
xuldoc->ResetDocumentLWTheme();
UpdateBrightTitlebarForeground(document);
}
}
else if (aName == nsGkAtoms::brighttitlebarforeground) {
UpdateBrightTitlebarForeground(document);
}
}
if (aName == nsGkAtoms::src && document) {
@ -1196,8 +1200,12 @@ nsXULElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
nsCOMPtr<nsIXULDocument> xuldoc = do_QueryInterface(doc);
if (xuldoc) {
xuldoc->ResetDocumentLWTheme();
UpdateBrightTitlebarForeground(doc);
}
}
else if (aName == nsGkAtoms::brighttitlebarforeground) {
UpdateBrightTitlebarForeground(doc);
}
else if (aName == nsGkAtoms::drawintitlebar) {
SetDrawsInTitlebar(false);
}
@ -1985,6 +1993,22 @@ nsXULElement::SetDrawsTitle(bool aState)
}
}
void
nsXULElement::UpdateBrightTitlebarForeground(nsIDocument* aDoc)
{
nsIWidget* mainWidget = GetWindowWidget();
if (mainWidget) {
// We can do this synchronously because SetBrightTitlebarForeground doesn't have any
// synchronous effects apart from a harmless invalidation.
mainWidget->SetUseBrightTitlebarForeground(
aDoc->GetDocumentLWTheme() == nsIDocument::Doc_Theme_Bright ||
aDoc->GetRootElement()->AttrValueIs(kNameSpaceID_None,
nsGkAtoms::brighttitlebarforeground,
NS_LITERAL_STRING("true"),
eCaseMatters));
}
}
class MarginSetter : public nsRunnable
{
public:

View File

@ -692,6 +692,7 @@ protected:
void SetDrawsInTitlebar(bool aState);
void SetDrawsTitle(bool aState);
void UpdateBrightTitlebarForeground(nsIDocument* aDocument);
void RemoveBroadcaster(const nsAString & broadcasterId);

View File

@ -455,7 +455,7 @@ class GCRuntime
inline void updateOnArenaFree(const ChunkInfo &info);
GCChunkSet::Range allChunks() { return chunkSet.all(); }
inline Chunk **getAvailableChunkList(Zone *zone);
Chunk **getAvailableChunkList();
void moveChunkToFreePool(Chunk *chunk, const AutoLockGC &lock);
bool hasChunk(Chunk *chunk) { return chunkSet.has(chunk); }
ChunkPool &emptyChunks(const AutoLockGC &lock) { return emptyChunks_; }
@ -479,7 +479,7 @@ class GCRuntime
private:
// For ArenaLists::allocateFromArena()
friend class ArenaLists;
Chunk *pickChunk(const AutoLockGC &lock, Zone *zone,
Chunk *pickChunk(const AutoLockGC &lock,
AutoMaybeStartBackgroundAllocation &maybeStartBGAlloc);
inline void arenaAllocatedDuringGC(JS::Zone *zone, ArenaHeader *arena);
@ -610,8 +610,7 @@ class GCRuntime
* During the GC when all arenas in a chunk become free, that chunk is
* removed from the list and scheduled for release.
*/
js::gc::Chunk *systemAvailableChunkListHead;
js::gc::Chunk *userAvailableChunkListHead;
js::gc::Chunk *availableChunkListHead;
js::gc::ChunkPool emptyChunks_;
js::RootedValueMap rootsHash;

View File

@ -941,7 +941,7 @@ struct Chunk
return info.numArenasFree != 0;
}
inline void addToAvailableList(JS::Zone *zone);
inline void addToAvailableList(JSRuntime *rt);
inline void insertToAvailableList(Chunk **insertPoint);
inline void removeFromAvailableList();

View File

@ -5366,11 +5366,10 @@ class MOZ_STACK_CLASS JS_PUBLIC_API(ForOfIterator) {
/*
* If a large allocation fails, the JS engine may call the large-allocation-
* failure callback, if set, to allow the embedding to flush caches, possibly
* perform shrinking GCs, etc. to make some room so that the allocation will
* succeed if retried. After the callback returns, the JS engine will try to
* allocate again and may be succesful.
* If a large allocation fails when calling pod_{calloc,realloc}CanGC, the JS
* engine may call the large-allocation- failure callback, if set, to allow the
* embedding to flush caches, possibly perform shrinking GCs, etc. to make some
* room. The allocation will then be retried (and may still fail.)
*/
typedef void

View File

@ -51,7 +51,6 @@ using mozilla::ArrayLength;
using mozilla::CeilingLog2;
using mozilla::DebugOnly;
using mozilla::IsNaN;
using mozilla::PointerRangeSize;
using JS::AutoCheckCannotGC;

View File

@ -838,18 +838,15 @@ Chunk::init(JSRuntime *rt)
}
inline Chunk **
GCRuntime::getAvailableChunkList(Zone *zone)
GCRuntime::getAvailableChunkList()
{
return zone->isSystem
? &systemAvailableChunkListHead
: &userAvailableChunkListHead;
return &availableChunkListHead;
}
inline void
Chunk::addToAvailableList(Zone *zone)
Chunk::addToAvailableList(JSRuntime *rt)
{
JSRuntime *rt = zone->runtimeFromAnyThread();
insertToAvailableList(rt->gc.getAvailableChunkList(zone));
insertToAvailableList(rt->gc.getAvailableChunkList());
}
inline void
@ -1052,7 +1049,7 @@ Chunk::releaseArena(ArenaHeader *aheader)
if (info.numArenasFree == 1) {
MOZ_ASSERT(!info.prevp);
MOZ_ASSERT(!info.next);
addToAvailableList(zone);
addToAvailableList(rt);
} else if (!unused()) {
MOZ_ASSERT(info.prevp);
} else {
@ -1122,10 +1119,10 @@ class js::gc::AutoMaybeStartBackgroundAllocation
};
Chunk *
GCRuntime::pickChunk(const AutoLockGC &lock, Zone *zone,
GCRuntime::pickChunk(const AutoLockGC &lock,
AutoMaybeStartBackgroundAllocation &maybeStartBackgroundAllocation)
{
Chunk **listHeadp = getAvailableChunkList(zone);
Chunk **listHeadp = getAvailableChunkList();
Chunk *chunk = *listHeadp;
if (chunk)
return chunk;
@ -1159,7 +1156,7 @@ GCRuntime::pickChunk(const AutoLockGC &lock, Zone *zone,
chunk->info.prevp = nullptr;
chunk->info.next = nullptr;
chunk->addToAvailableList(zone);
chunk->addToAvailableList(rt);
return chunk;
}
@ -1174,8 +1171,7 @@ GCRuntime::GCRuntime(JSRuntime *rt) :
stats(rt),
marker(rt),
usage(nullptr),
systemAvailableChunkListHead(nullptr),
userAvailableChunkListHead(nullptr),
availableChunkListHead(nullptr),
maxMallocBytes(0),
numArenasFreeCommitted(0),
verifyPreData(nullptr),
@ -1418,8 +1414,7 @@ GCRuntime::finish()
zones.clear();
systemAvailableChunkListHead = nullptr;
userAvailableChunkListHead = nullptr;
availableChunkListHead = nullptr;
if (chunkSet.initialized()) {
for (GCChunkSet::Range r(chunkSet.all()); !r.empty(); r.popFront())
releaseChunk(r.front());
@ -1990,7 +1985,7 @@ ArenaLists::allocateFromArena(JS::Zone *zone, AllocKind thingKind,
if (maybeLock.isNothing())
maybeLock.emplace(rt);
Chunk *chunk = rt->gc.pickChunk(maybeLock.ref(), zone, maybeStartBGAlloc);
Chunk *chunk = rt->gc.pickChunk(maybeLock.ref(), maybeStartBGAlloc);
if (!chunk)
return nullptr;
@ -3243,8 +3238,7 @@ GCRuntime::decommitArenasFromAvailableList(Chunk **availableListHeadp)
void
GCRuntime::decommitArenas()
{
decommitArenasFromAvailableList(&systemAvailableChunkListHead);
decommitArenasFromAvailableList(&userAvailableChunkListHead);
decommitArenasFromAvailableList(&availableChunkListHead);
}
void

View File

@ -699,9 +699,8 @@ JSRuntime::onOutOfMemory(void *p, size_t nbytes, JSContext *cx)
void *
JSRuntime::onOutOfMemoryCanGC(void *p, size_t bytes)
{
if (!largeAllocationFailureCallback || bytes < LARGE_ALLOCATION)
return nullptr;
largeAllocationFailureCallback(largeAllocationFailureCallbackData);
if (largeAllocationFailureCallback && bytes >= LARGE_ALLOCATION)
largeAllocationFailureCallback(largeAllocationFailureCallbackData);
return onOutOfMemory(p, bytes);
}

View File

@ -45,13 +45,6 @@ if CONFIG['VPX_X86_ASM']:
if CONFIG['OS_TARGET'] == 'Darwin' or (CONFIG['OS_TARGET'] == 'WINNT' and CONFIG['GNU_CC']):
SOURCES += files['AVX2']
# Expected support is hard-coded in the various vpx_config files but
# we need to propagate the config checks here to get the right flags.
if CONFIG['HAVE_TOOLCHAIN_SUPPORT_MSSSE3']:
CFLAGS += ['-mssse3']
if CONFIG['HAVE_TOOLCHAIN_SUPPORT_MSSE4_1']:
CFLAGS += ['-msse4.1']
#postproc is only enabled on x86 with asm
SOURCES += files['VP8_POSTPROC']
@ -103,6 +96,8 @@ if not CONFIG['_MSC_VER']:
SOURCES[f].flags += CONFIG['SSE2_FLAGS']
if 'ssse3' in f:
SOURCES[f].flags += ['-mssse3']
if 'sse4' in f:
SOURCES[f].flags += ['-msse4.1']
if 'avx2' in f:
SOURCES[f].flags += ['-mavx2']

View File

@ -25,10 +25,16 @@
namespace mozilla {
/*
* Safely subtract two pointers when it is known that aEnd >= aBegin. This
* avoids the common compiler bug that if (size_t(aEnd) - size_t(aBegin)) has
* the MSB set, the unsigned subtraction followed by right shift will produce
* -1, or size_t(-1), instead of the real difference.
* Safely subtract two pointers when it is known that aEnd >= aBegin, yielding a
* size_t result.
*
* Ordinary pointer subtraction yields a ptrdiff_t result, which, being signed,
* has insufficient range to express the distance between pointers at opposite
* ends of the address space. Furthermore, most compilers use ptrdiff_t to
* represent the intermediate byte address distance, before dividing by
* sizeof(T); if that intermediate result overflows, they'll produce results
* with the wrong sign even when the correct scaled distance would fit in a
* ptrdiff_t.
*/
template<class T>
MOZ_ALWAYS_INLINE size_t

View File

@ -82,11 +82,8 @@ template<typename T>
static MOZ_ALWAYS_INLINE void
PodAssign(T* aDst, const T* aSrc)
{
MOZ_ASSERT(aDst != aSrc);
MOZ_ASSERT_IF(aSrc < aDst,
PointerRangeSize(aSrc, static_cast<const T*>(aDst)) >= 1);
MOZ_ASSERT_IF(aDst < aSrc,
PointerRangeSize(static_cast<const T*>(aDst), aSrc) >= 1);
MOZ_ASSERT(aDst + 1 <= aSrc || aSrc + 1 <= aDst,
"destination and source must not overlap");
memcpy(reinterpret_cast<char*>(aDst), reinterpret_cast<const char*>(aSrc),
sizeof(T));
}
@ -99,12 +96,8 @@ template<typename T>
static MOZ_ALWAYS_INLINE void
PodCopy(T* aDst, const T* aSrc, size_t aNElem)
{
MOZ_ASSERT(aDst != aSrc);
MOZ_ASSERT_IF(aSrc < aDst,
PointerRangeSize(aSrc, static_cast<const T*>(aDst)) >= aNElem);
MOZ_ASSERT_IF(aDst < aSrc,
PointerRangeSize(static_cast<const T*>(aDst), aSrc) >= aNElem);
MOZ_ASSERT(aDst + aNElem <= aSrc || aSrc + aNElem <= aDst,
"destination and source must not overlap");
if (aNElem < 128) {
/*
* Avoid using operator= in this loop, as it may have been
@ -122,11 +115,8 @@ template<typename T>
static MOZ_ALWAYS_INLINE void
PodCopy(volatile T* aDst, const volatile T* aSrc, size_t aNElem)
{
MOZ_ASSERT(aDst != aSrc);
MOZ_ASSERT_IF(aSrc < aDst,
PointerRangeSize(aSrc, static_cast<const volatile T*>(aDst)) >= aNElem);
MOZ_ASSERT_IF(aDst < aSrc,
PointerRangeSize(static_cast<const volatile T*>(aDst), aSrc) >= aNElem);
MOZ_ASSERT(aDst + aNElem <= aSrc || aSrc + aNElem <= aDst,
"destination and source must not overlap");
/*
* Volatile |aDst| requires extra work, because it's undefined behavior to

View File

@ -2049,7 +2049,7 @@ pref("layout.css.clip-path-shapes.enabled", false);
pref("layout.css.sticky.enabled", true);
// Is support for CSS "will-change" enabled?
pref("layout.css.will-change.enabled", false);
pref("layout.css.will-change.enabled", true);
// Is support for DOMPoint enabled?
pref("layout.css.DOMPoint.enabled", true);

View File

@ -413,6 +413,12 @@ class TreeMetadataEmitter(LoggingMixin):
if v in context and context[v]:
passthru.variables[v] = context[v]
if context.config.substs.get('OS_TARGET') == 'WINNT' and \
context['DELAYLOAD_DLLS']:
context['LDFLAGS'].extend([('-DELAYLOAD:%s' % dll)
for dll in context['DELAYLOAD_DLLS']])
context['OS_LIBS'].append('delayimp')
for v in ['CFLAGS', 'CXXFLAGS', 'CMFLAGS', 'CMMFLAGS', 'LDFLAGS']:
if v in context and context[v]:
passthru.variables['MOZBUILD_' + v] = context[v]
@ -421,11 +427,6 @@ class TreeMetadataEmitter(LoggingMixin):
if context['NO_VISIBILITY_FLAGS']:
passthru.variables['VISIBILITY_FLAGS'] = ''
if context['DELAYLOAD_DLLS']:
passthru.variables['DELAYLOAD_LDFLAGS'] = [('-DELAYLOAD:%s' % dll)
for dll in context['DELAYLOAD_DLLS']]
passthru.variables['USE_DELAYIMP'] = True
varmap = dict(
SOURCES={
'.s': 'ASFILES',

View File

@ -31,7 +31,7 @@ test_data_path = mozpath.join(test_data_path, 'data')
CONFIGS = defaultdict(lambda: {
'defines': [],
'non_global_defines': [],
'substs': [],
'substs': [('OS_TARGET', 'WINNT')],
}, {
'android_eclipse': {
'defines': [

View File

@ -304,13 +304,6 @@ class TestRecursiveMakeBackend(BackendTester):
'VISIBILITY_FLAGS': [
'VISIBILITY_FLAGS :=',
],
'DELAYLOAD_LDFLAGS': [
'DELAYLOAD_LDFLAGS += -DELAYLOAD:foo.dll',
'DELAYLOAD_LDFLAGS += -DELAYLOAD:bar.dll',
],
'USE_DELAYIMP': [
'USE_DELAYIMP := 1',
],
'RCFILE': [
'RCFILE := foo.rc',
],
@ -337,6 +330,8 @@ class TestRecursiveMakeBackend(BackendTester):
'MOZBUILD_LDFLAGS': [
'MOZBUILD_LDFLAGS += -framework Foo',
'MOZBUILD_LDFLAGS += -x',
'MOZBUILD_LDFLAGS += -DELAYLOAD:foo.dll',
'MOZBUILD_LDFLAGS += -DELAYLOAD:bar.dll',
],
'WIN32_EXE_LDFLAGS': [
'WIN32_EXE_LDFLAGS += -subsystem:console',

View File

@ -56,6 +56,7 @@ class TestEmitterBasic(unittest.TestCase):
config = MockConfig(mozpath.join(data_path, name), extra_substs=dict(
ENABLE_TESTS='1',
BIN_SUFFIX='.prog',
OS_TARGET='WINNT',
))
return BuildReader(config)
@ -148,32 +149,31 @@ class TestEmitterBasic(unittest.TestCase):
self.assertEqual(len(objs), 1)
self.assertIsInstance(objs[0], VariablePassthru)
wanted = dict(
ASFILES=['fans.asm', 'tans.s'],
CMMSRCS=['fans.mm', 'tans.mm'],
CSRCS=['fans.c', 'tans.c'],
DISABLE_STL_WRAPPING=True,
EXTRA_COMPONENTS=['fans.js', 'tans.js'],
EXTRA_PP_COMPONENTS=['fans.pp.js', 'tans.pp.js'],
FAIL_ON_WARNINGS=True,
HOST_CPPSRCS=['fans.cpp', 'tans.cpp'],
HOST_CSRCS=['fans.c', 'tans.c'],
MSVC_ENABLE_PGO=True,
NO_DIST_INSTALL=True,
SSRCS=['bans.S', 'fans.S'],
VISIBILITY_FLAGS='',
DELAYLOAD_LDFLAGS=['-DELAYLOAD:foo.dll', '-DELAYLOAD:bar.dll'],
USE_DELAYIMP=True,
RCFILE='foo.rc',
RESFILE='bar.res',
RCINCLUDE='bar.rc',
DEFFILE='baz.def',
USE_STATIC_LIBS=True,
MOZBUILD_CFLAGS=['-fno-exceptions', '-w'],
MOZBUILD_CXXFLAGS=['-fcxx-exceptions', '-include foo.h'],
MOZBUILD_LDFLAGS=['-framework Foo', '-x'],
WIN32_EXE_LDFLAGS=['-subsystem:console'],
)
wanted = {
'ASFILES': ['fans.asm', 'tans.s'],
'CMMSRCS': ['fans.mm', 'tans.mm'],
'CSRCS': ['fans.c', 'tans.c'],
'DISABLE_STL_WRAPPING': True,
'EXTRA_COMPONENTS': ['fans.js', 'tans.js'],
'EXTRA_PP_COMPONENTS': ['fans.pp.js', 'tans.pp.js'],
'FAIL_ON_WARNINGS': True,
'HOST_CPPSRCS': ['fans.cpp', 'tans.cpp'],
'HOST_CSRCS': ['fans.c', 'tans.c'],
'MSVC_ENABLE_PGO': True,
'NO_DIST_INSTALL': True,
'SSRCS': ['bans.S', 'fans.S'],
'VISIBILITY_FLAGS': '',
'RCFILE': 'foo.rc',
'RESFILE': 'bar.res',
'RCINCLUDE': 'bar.rc',
'DEFFILE': 'baz.def',
'USE_STATIC_LIBS': True,
'MOZBUILD_CFLAGS': ['-fno-exceptions', '-w'],
'MOZBUILD_CXXFLAGS': ['-fcxx-exceptions', '-include foo.h'],
'MOZBUILD_LDFLAGS': ['-framework Foo', '-x', '-DELAYLOAD:foo.dll',
'-DELAYLOAD:bar.dll'],
'WIN32_EXE_LDFLAGS': ['-subsystem:console'],
}
variables = objs[0].variables
maxDiff = self.maxDiff

View File

@ -3,6 +3,8 @@
# 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/.
INTERNAL_TOOLS = 1
UNIT_FILES = $(SHARED_LIBRARY) CrashTestUtils.jsm
UNIT_DEST = $(DEPTH)/_tests/xpcshell/$(relativesrcdir)/unit/
INSTALL_TARGETS += UNIT

View File

@ -80,6 +80,13 @@ class ToolLauncher(object):
for e in extra_env:
env[e] = extra_env[e]
# For VC12, make sure we can find the right bitness of pgort120.dll
if 'VS120COMNTOOLS' in env and not buildconfig.substs['HAVE_64BIT_BUILD']:
vc12dir = os.path.abspath(os.path.join(env['VS120COMNTOOLS'],
'../../VC/bin'))
if os.path.exists(vc12dir):
env['PATH'] = vc12dir + ';' + env['PATH']
# Work around a bug in Python 2.7.2 and lower where unicode types in
# environment variables aren't handled by subprocess.
for k, v in env.items():
@ -138,14 +145,6 @@ def precompile_cache(formatter, source_path, gre_path, app_path):
os.close(fd)
os.remove(cache)
# For VC12, make sure we can find the right bitness of pgort120.dll
env = os.environ.copy()
if 'VS120COMNTOOLS' in env and not buildconfig.substs['HAVE_64BIT_BUILD']:
vc12dir = os.path.abspath(os.path.join(env['VS120COMNTOOLS'],
'../../VC/bin'))
if os.path.exists(vc12dir):
env['PATH'] = vc12dir + ';' + env['PATH']
try:
if launcher.launch(['xpcshell', '-g', gre_path, '-a', app_path,
'-f', os.path.join(os.path.dirname(__file__),
@ -153,8 +152,7 @@ def precompile_cache(formatter, source_path, gre_path, app_path):
'-e', 'precompile_startupcache("resource://%s/");'
% resource],
extra_linker_path=gre_path,
extra_env={'MOZ_STARTUP_CACHE': cache,
'PATH': env['PATH']}):
extra_env={'MOZ_STARTUP_CACHE': cache}):
errors.fatal('Error while running startup cache precompilation')
return
from mozpack.mozjar import JarReader

View File

@ -2431,7 +2431,27 @@ nsChildView::UpdateTitlebarCGContext()
[NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithGraphicsPort:ctx flipped:[view isFlipped]]];
[cell drawWithFrame:[button bounds] inView:button];
if ([window useBrightTitlebarForeground] && !nsCocoaFeatures::OnYosemiteOrLater() &&
view == [window standardWindowButton:NSWindowFullScreenButton]) {
// Make the fullscreen button visible on dark titlebar backgrounds by
// drawing it into a new transparency layer and turning it white.
CGRect r = NSRectToCGRect([view bounds]);
CGContextBeginTransparencyLayerWithRect(ctx, r, nullptr);
// Draw twice for double opacity.
[cell drawWithFrame:[button bounds] inView:button];
[cell drawWithFrame:[button bounds] inView:button];
// Make it white.
CGContextSetBlendMode(ctx, kCGBlendModeSourceIn);
CGContextSetRGBFillColor(ctx, 1, 1, 1, 1);
CGContextFillRect(ctx, r);
CGContextSetBlendMode(ctx, kCGBlendModeNormal);
CGContextEndTransparencyLayer(ctx);
} else {
[cell drawWithFrame:[button bounds] inView:button];
}
[NSGraphicsContext setCurrentContext:context];
CGContextRestoreGState(ctx);

View File

@ -79,6 +79,7 @@ typedef struct _nsCocoaWindowList {
BOOL mBeingShown;
BOOL mDrawTitle;
BOOL mBrightTitlebarForeground;
}
- (void)importState:(NSDictionary*)aState;
@ -109,6 +110,9 @@ typedef struct _nsCocoaWindowList {
- (void)setWantsTitleDrawn:(BOOL)aDrawTitle;
- (BOOL)wantsTitleDrawn;
- (void)setUseBrightTitlebarForeground:(BOOL)aBrightForeground;
- (BOOL)useBrightTitlebarForeground;
- (void)disableSetNeedsDisplay;
- (void)enableSetNeedsDisplay;
@ -302,6 +306,7 @@ public:
virtual void SetShowsFullScreenButton(bool aShow);
virtual void SetWindowAnimationType(WindowAnimationType aType);
virtual void SetDrawsTitle(bool aDrawTitle);
virtual void SetUseBrightTitlebarForeground(bool aBrightForeground) MOZ_OVERRIDE;
NS_IMETHOD SetNonClientMargins(nsIntMargin &margins);
NS_IMETHOD SetWindowTitlebarColor(nscolor aColor, bool aActive);
virtual void SetDrawsInTitlebar(bool aState);

View File

@ -2000,6 +2000,16 @@ nsCocoaWindow::SetDrawsTitle(bool aDrawTitle)
NS_OBJC_END_TRY_ABORT_BLOCK;
}
void
nsCocoaWindow::SetUseBrightTitlebarForeground(bool aBrightForeground)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
[mWindow setUseBrightTitlebarForeground:aBrightForeground];
NS_OBJC_END_TRY_ABORT_BLOCK;
}
NS_IMETHODIMP nsCocoaWindow::SetNonClientMargins(nsIntMargin &margins)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
@ -2642,6 +2652,7 @@ static NSMutableSet *gSwizzledFrameViewClasses = nil;
mTrackingArea = nil;
mBeingShown = NO;
mDrawTitle = NO;
mBrightTitlebarForeground = NO;
[self updateTrackingArea];
return self;
@ -2740,6 +2751,17 @@ static const NSString* kStateShowsToolbarButton = @"showsToolbarButton";
return mDrawTitle;
}
- (void)setUseBrightTitlebarForeground:(BOOL)aBrightForeground
{
mBrightTitlebarForeground = aBrightForeground;
[[self standardWindowButton:NSWindowFullScreenButton] setNeedsDisplay:YES];
}
- (BOOL)useBrightTitlebarForeground
{
return mBrightTitlebarForeground;
}
// Pass nil here to get the default appearance.
- (void)setTitlebarColor:(NSColor*)aColor forActiveWindow:(BOOL)aActive
{

View File

@ -98,8 +98,8 @@ typedef void* nsNativeWidget;
#endif
#define NS_IWIDGET_IID \
{ 0x5b27abd6, 0x9e53, 0x4a0a, \
{ 0x86, 0xf, 0x77, 0x5c, 0xc5, 0x69, 0x35, 0xf } };
{ 0xcfe7543b, 0x8c0e, 0x40c3, \
{ 0x9a, 0x6d, 0x77, 0x6e, 0x84, 0x8a, 0x7c, 0xfc } };
/*
* Window shadow styles
@ -1366,6 +1366,12 @@ class nsIWidget : public nsISupports {
*/
virtual void SetDrawsTitle(bool aDrawTitle) {}
/**
* Indicates whether the widget should attempt to make titlebar controls
* easier to see on dark titlebar backgrounds.
*/
virtual void SetUseBrightTitlebarForeground(bool aBrightForeground) {}
/**
* Hide window chrome (borders, buttons) for this widget.
*