Merge mozilla-central to autoland

This commit is contained in:
Iris Hsiao 2017-04-24 14:28:11 +08:00
Родитель 96edbf3f86 0adc572c43
Коммит 7e2d844c6e
18 изменённых файлов: 17935 добавлений и 17905 удалений

Просмотреть файл

@ -224,6 +224,13 @@ const PanelUI = {
// If it's not a string, assume RegExp
notifications = this.notifications.filter(n => id.test(n.id));
}
// _updateNotifications can be expensive if it forces attachment of XBL
// bindings that haven't been used yet, so return early if we haven't found
// any notification to remove, as callers may expect this removeNotification
// method to be a no-op for non-existent notifications.
if (!notifications.length) {
return;
}
notifications.forEach(n => {
this._removeNotification(n);

Просмотреть файл

@ -1047,6 +1047,7 @@ JSCompartment::purge()
dtoaCache.purge();
newProxyCache.purge();
lastCachedNativeIterator = nullptr;
objectGroups.purge();
}
void

Просмотреть файл

@ -461,6 +461,20 @@ class ObjectGroupCompartment::NewTable : public JS::WeakCache<js::GCHashSet<NewE
explicit NewTable(Zone* zone) : Base(zone, Table()) {}
};
MOZ_ALWAYS_INLINE ObjectGroup*
ObjectGroupCompartment::DefaultNewGroupCache::lookup(const Class* clasp, TaggedProto proto,
JSObject* associated)
{
if (group_ &&
associated_ == associated &&
group_->proto() == proto &&
(!clasp || group_->clasp() == clasp))
{
return group_;
}
return nullptr;
}
/* static */ ObjectGroup*
ObjectGroup::defaultNewGroup(JSContext* cx, const Class* clasp,
TaggedProto proto, JSObject* associated)
@ -473,20 +487,6 @@ ObjectGroup::defaultNewGroup(JSContext* cx, const Class* clasp,
// unboxed plain object.
MOZ_ASSERT_IF(!clasp, !!associated);
AutoEnterAnalysis enter(cx);
ObjectGroupCompartment::NewTable*& table = cx->compartment()->objectGroups.defaultNewTable;
if (!table) {
table = cx->new_<ObjectGroupCompartment::NewTable>(cx->zone());
if (!table || !table->init()) {
js_delete(table);
table = nullptr;
ReportOutOfMemory(cx);
return nullptr;
}
}
if (associated && !associated->is<TypeDescr>()) {
MOZ_ASSERT(!clasp);
if (associated->is<JSFunction>()) {
@ -513,6 +513,25 @@ ObjectGroup::defaultNewGroup(JSContext* cx, const Class* clasp,
clasp = &PlainObject::class_;
}
ObjectGroupCompartment& groups = cx->compartment()->objectGroups;
if (ObjectGroup* group = groups.defaultNewGroupCache.lookup(clasp, proto, associated))
return group;
AutoEnterAnalysis enter(cx);
ObjectGroupCompartment::NewTable*& table = groups.defaultNewTable;
if (!table) {
table = cx->new_<ObjectGroupCompartment::NewTable>(cx->zone());
if (!table || !table->init()) {
js_delete(table);
table = nullptr;
ReportOutOfMemory(cx);
return nullptr;
}
}
if (proto.isObject() && !proto.toObject()->isDelegate()) {
RootedObject protoObj(cx, proto.toObject());
if (!JSObject::setDelegate(cx, protoObj))
@ -536,6 +555,7 @@ ObjectGroup::defaultNewGroup(JSContext* cx, const Class* clasp,
MOZ_ASSERT_IF(!clasp, group->clasp() == &PlainObject::class_ ||
group->clasp() == &UnboxedPlainObject::class_);
MOZ_ASSERT(group->proto() == proto);
groups.defaultNewGroupCache.put(group, associated);
return group;
}
@ -582,6 +602,7 @@ ObjectGroup::defaultNewGroup(JSContext* cx, const Class* clasp,
AddTypePropertyId(cx, group, nullptr, NameToId(names.columnNumber), TypeSet::Int32Type());
}
groups.defaultNewGroupCache.put(group, associated);
return group;
}
@ -1681,6 +1702,7 @@ ObjectGroupCompartment::removeDefaultNewGroup(const Class* clasp, TaggedProto pr
MOZ_RELEASE_ASSERT(p);
defaultNewTable->get().remove(p);
defaultNewGroupCache.purge();
}
void
@ -1692,6 +1714,7 @@ ObjectGroupCompartment::replaceDefaultNewGroup(const Class* clasp, TaggedProto p
auto p = defaultNewTable->lookup(lookup);
MOZ_RELEASE_ASSERT(p);
defaultNewTable->get().remove(p);
defaultNewGroupCache.purge();
{
AutoEnterOOMUnsafeRegion oomUnsafe;
if (!defaultNewTable->putNew(lookup, NewEntry(group, associated)))
@ -1770,6 +1793,7 @@ ObjectGroupCompartment::clearTables()
defaultNewTable->clear();
if (lazyTable && lazyTable->initialized())
lazyTable->clear();
defaultNewGroupCache.purge();
}
/* static */ bool

Просмотреть файл

@ -566,6 +566,28 @@ class ObjectGroupCompartment
NewTable* defaultNewTable;
NewTable* lazyTable;
// Cache for defaultNewGroup. Purged on GC.
class DefaultNewGroupCache
{
ObjectGroup* group_;
JSObject* associated_;
public:
DefaultNewGroupCache() { purge(); }
void purge() {
group_ = nullptr;
}
void put(ObjectGroup* group, JSObject* associated) {
group_ = group;
associated_ = associated;
}
MOZ_ALWAYS_INLINE ObjectGroup* lookup(const Class* clasp, TaggedProto proto,
JSObject* associated);
};
DefaultNewGroupCache defaultNewGroupCache;
struct ArrayObjectKey;
using ArrayObjectTable = js::GCRekeyableHashMap<ArrayObjectKey,
ReadBarrieredObjectGroup,
@ -628,6 +650,10 @@ class ObjectGroupCompartment
void sweep(FreeOp* fop);
void purge() {
defaultNewGroupCache.purge();
}
#ifdef JSGC_HASH_TABLE_CHECKS
void checkTablesAfterMovingGC() {
checkNewTableAfterMovingGC(defaultNewTable);

Просмотреть файл

@ -113,11 +113,11 @@ NS_NewRootBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
NS_IMPL_FRAMEARENA_HELPERS(nsRootBoxFrame)
nsRootBoxFrame::nsRootBoxFrame(nsStyleContext* aContext):
nsBoxFrame(aContext, true)
nsRootBoxFrame::nsRootBoxFrame(nsStyleContext* aContext)
: nsBoxFrame(aContext, true)
, mPopupSetFrame(nullptr)
, mDefaultTooltip(nullptr)
{
mPopupSetFrame = nullptr;
nsCOMPtr<nsBoxLayout> layout;
NS_NewStackLayout(layout);
SetXULLayoutManager(layout);

Просмотреть файл

@ -264,7 +264,7 @@
#include ../search/manifests/SearchAndroidManifest_activities.xml.in
#endif
#ifdef MOZ_CRASHREPORTER
#if MOZ_CRASHREPORTER
<activity android:name="org.mozilla.gecko.CrashReporter"
android:process="@ANDROID_PACKAGE_NAME@.CrashReporter"
android:label="@string/crash_reporter_title"

Просмотреть файл

@ -191,7 +191,7 @@ public class AppConstants {
//#endif
public static final boolean MOZ_CRASHREPORTER =
//#ifdef MOZ_CRASHREPORTER
//#if MOZ_CRASHREPORTER
true;
//#else
false;

Просмотреть файл

@ -8,6 +8,28 @@ ifdef MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE
.NOTPARALLEL:
endif
MOZ_BUILDID := $(shell awk '{print $$3}' $(DEPTH)/buildid.h)
# Set the appropriate version code, based on the existance of the
# MOZ_APP_ANDROID_VERSION_CODE variable.
ifdef MOZ_APP_ANDROID_VERSION_CODE
ANDROID_VERSION_CODE:=$(MOZ_APP_ANDROID_VERSION_CODE)
else
ANDROID_VERSION_CODE:=$(shell $(PYTHON) \
$(topsrcdir)/python/mozbuild/mozbuild/android_version_code.py \
--verbose \
--with-android-cpu-arch=$(ANDROID_CPU_ARCH) \
$(if $(MOZ_ANDROID_MIN_SDK_VERSION),--with-android-min-sdk=$(MOZ_ANDROID_MIN_SDK_VERSION)) \
$(if $(MOZ_ANDROID_MAX_SDK_VERSION),--with-android-max-sdk=$(MOZ_ANDROID_MAX_SDK_VERSION)) \
$(MOZ_BUILDID))
endif
DEFINES += \
-DANDROID_VERSION_CODE=$(ANDROID_VERSION_CODE) \
-DMOZ_ANDROID_SHARED_ID="$(MOZ_ANDROID_SHARED_ID)" \
-DMOZ_BUILDID=$(MOZ_BUILDID) \
$(NULL)
GARBAGE += \
classes.dex \
gecko.ap_ \
@ -287,7 +309,7 @@ classycle_jar := $(topsrcdir)/mobile/android/build/classycle/classycle-1.4.1.jar
-outjars jars-proguarded \
-libraryjars $(library_jars)
ANNOTATION_PROCESSOR_JAR_FILES := $(abspath $(DEPTH)/build/annotationProcessors/annotationProcessors.jar)
ANNOTATION_PROCESSOR_JAR_FILES := $(DEPTH)/build/annotationProcessors/annotationProcessors.jar
# This annotation processing step also generates
# GeneratedJNIWrappers.h and GeneratedJNINatives.h
@ -353,7 +375,7 @@ res/raw/browsersearch.json: .locales.deps ;
res/raw/suggestedsites.json: .locales.deps ;
all_resources = \
$(abspath $(DEPTH)/mobile/android/base/AndroidManifest.xml) \
$(DEPTH)/mobile/android/base/AndroidManifest.xml \
$(android_res_files) \
$(ANDROID_GENERATED_RESFILES) \
$(NULL)
@ -457,8 +479,8 @@ ifdef MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE
.aapt.nodeps: FORCE
cp $(gradle_dir)/app/intermediates/res/resources-automation-debug.ap_ gecko-nodeps.ap_
else
# .aapt.nodeps: $(abspath $(DEPTH)/mobile/android/base/AndroidManifest.xml) FORCE
$(eval $(call aapt_command,.aapt.nodeps,$(abspath $(DEPTH)/mobile/android/base/AndroidManifest.xml) FORCE,gecko-nodeps.ap_,gecko-nodeps/,gecko-nodeps/))
# .aapt.nodeps: $(DEPTH)/mobile/android/base/AndroidManifest.xml FORCE
$(eval $(call aapt_command,.aapt.nodeps,$(DEPTH)/mobile/android/base/AndroidManifest.xml FORCE,gecko-nodeps.ap_,gecko-nodeps/,gecko-nodeps/))
endif
# Override the Java settings with some specific android settings
@ -493,7 +515,7 @@ $(ABS_DIST)/fennec/$(OMNIJAR_NAME): FORCE
# Targets built very early during a Gradle build.
gradle-targets: $(foreach f,$(constants_PP_JAVAFILES),$(f))
gradle-targets: $(abspath $(DEPTH)/mobile/android/base/AndroidManifest.xml)
gradle-targets: $(DEPTH)/mobile/android/base/AndroidManifest.xml
gradle-targets: $(ANDROID_GENERATED_RESFILES)
ifndef MOZILLA_OFFICIAL

Просмотреть файл

@ -28,7 +28,6 @@ import sys
import buildconfig
from mozbuild import preprocessor
from mozbuild.android_version_code import android_version_code
def _defines():
@ -46,7 +45,6 @@ def _defines():
'MOZ_ANDROID_GCM',
'MOZ_ANDROID_MLS_STUMBLER',
'MOZ_ANDROID_SEARCH_ACTIVITY',
'MOZ_CRASHREPORTER',
'MOZ_DEBUG',
'MOZ_INSTALL_TRACKING',
'MOZ_LOCALE_SWITCHER',
@ -64,7 +62,6 @@ def _defines():
for var in ('ANDROID_CPU_ARCH',
'ANDROID_PACKAGE_NAME',
'GRE_MILESTONE',
'MOZ_ANDROID_SHARED_ID',
'MOZ_ANDROID_APPLICATION_CLASS',
'MOZ_ANDROID_BROWSER_INTENT_CLASS',
'MOZ_ANDROID_SEARCH_INTENT_CLASS',
@ -76,6 +73,7 @@ def _defines():
'MOZ_APP_VENDOR',
'MOZ_APP_VERSION',
'MOZ_CHILD_PROCESS_NAME',
'MOZ_CRASHREPORTER',
'MOZ_MOZILLA_API_KEY',
'MOZ_UPDATE_CHANNEL',
'OMNIJAR_NAME',
@ -103,19 +101,6 @@ def _defines():
DEFINES['MOZ_BUILDID'] = open(os.path.join(buildconfig.topobjdir, 'buildid.h')).readline().split()[2]
# Set the appropriate version code if not set by MOZ_APP_ANDROID_VERSION_CODE.
if CONFIG.get('MOZ_APP_ANDROID_VERSION_CODE'):
DEFINES['ANDROID_VERSION_CODE'] = \
CONFIG.get('MOZ_APP_ANDROID_VERSION_CODE')
else:
min_sdk = int(CONFIG.get('MOZ_ANDROID_MIN_SDK_VERSION') or '0') or None
max_sdk = int(CONFIG.get('MOZ_ANDROID_MAX_SDK_VERSION') or '0') or None
DEFINES['ANDROID_VERSION_CODE'] = android_version_code(
buildid=DEFINES['MOZ_BUILDID'],
cpu_arch=CONFIG['ANDROID_CPU_ARCH'],
min_sdk=min_sdk,
max_sdk=max_sdk)
return DEFINES
@ -123,15 +108,6 @@ def generate_java(output_file, input_filename):
includes = preprocessor.preprocess(includes=[input_filename],
defines=_defines(),
output=output_file,
marker='//#')
includes.add(os.path.join(buildconfig.topobjdir, 'buildid.h'))
return includes
def generate_android_manifest(output_file, input_filename):
includes = preprocessor.preprocess(includes=[input_filename],
defines=_defines(),
output=output_file,
marker='#')
marker="//#")
includes.add(os.path.join(buildconfig.topobjdir, 'buildid.h'))
return includes

Просмотреть файл

@ -119,7 +119,6 @@ DIRS += ['locales']
GENERATED_FILES += [
'../geckoview/generated/preprocessed/org/mozilla/geckoview/BuildConfig.java',
'AndroidManifest.xml',
'generated/preprocessed/org/mozilla/gecko/AdjustConstants.java',
'generated/preprocessed/org/mozilla/gecko/AppConstants.java',
]
@ -132,9 +131,6 @@ x.inputs += ['AdjustConstants.java.in']
y = GENERATED_FILES['generated/preprocessed/org/mozilla/gecko/AppConstants.java']
y.script = 'generate_build_config.py:generate_java'
y.inputs += ['AppConstants.java.in']
z = GENERATED_FILES['AndroidManifest.xml']
z.script = 'generate_build_config.py:generate_android_manifest'
z.inputs += ['AndroidManifest.xml.in']
include('android-services.mozbuild')
@ -1233,6 +1229,45 @@ if CONFIG['MOZ_ANDROID_DISTRIBUTION_DIRECTORY']:
'%' + CONFIG['MOZ_ANDROID_DISTRIBUTION_DIRECTORY'] + '/assets',
]
# We do not expose MOZ_ADJUST_SDK_KEY here because that # would leak the value
# to build logs. Instead we expose the token quietly where appropriate in
# Makefile.in.
for var in ('MOZ_ANDROID_ANR_REPORTER', 'MOZ_DEBUG',
'MOZ_ANDROID_SEARCH_ACTIVITY', 'MOZ_NATIVE_DEVICES', 'MOZ_ANDROID_MLS_STUMBLER',
'MOZ_ANDROID_DOWNLOADS_INTEGRATION', 'MOZ_INSTALL_TRACKING',
'MOZ_ANDROID_GCM', 'MOZ_ANDROID_EXCLUDE_FONTS', 'MOZ_LOCALE_SWITCHER',
'MOZ_ANDROID_BEAM', 'MOZ_ANDROID_DOWNLOAD_CONTENT_SERVICE',
'MOZ_SWITCHBOARD', 'MOZ_ANDROID_CUSTOM_TABS',
'MOZ_ANDROID_ACTIVITY_STREAM'):
if CONFIG[var]:
DEFINES[var] = 1
for var in ('MOZ_UPDATER', 'MOZ_PKG_SPECIAL', 'MOZ_ANDROID_GCM_SENDERID'):
if CONFIG[var]:
DEFINES[var] = CONFIG[var]
for var in ('ANDROID_PACKAGE_NAME', 'ANDROID_CPU_ARCH',
'GRE_MILESTONE', 'MOZ_APP_BASENAME', 'MOZ_MOZILLA_API_KEY',
'MOZ_APP_DISPLAYNAME', 'MOZ_APP_UA_NAME', 'MOZ_APP_ID', 'MOZ_APP_NAME',
'MOZ_APP_VENDOR', 'MOZ_APP_VERSION', 'MOZ_CHILD_PROCESS_NAME',
'MOZ_ANDROID_APPLICATION_CLASS', 'MOZ_ANDROID_BROWSER_INTENT_CLASS', 'MOZ_ANDROID_SEARCH_INTENT_CLASS',
'MOZ_CRASHREPORTER', 'MOZ_UPDATE_CHANNEL', 'OMNIJAR_NAME',
'OS_TARGET', 'TARGET_XPCOM_ABI'):
DEFINES[var] = CONFIG[var]
# Mangle our package name to avoid Bug 750548.
DEFINES['MANGLED_ANDROID_PACKAGE_NAME'] = CONFIG['ANDROID_PACKAGE_NAME'].replace('fennec', 'f3nn3c')
DEFINES['MOZ_APP_ABI'] = CONFIG['TARGET_XPCOM_ABI']
if not CONFIG['COMPILE_ENVIRONMENT']:
# These should really come from the included binaries, but that's not easy.
DEFINES['MOZ_APP_ABI'] = 'arm-eabi-gcc3' # Observe quote differences here ...
DEFINES['TARGET_XPCOM_ABI'] = '"arm-eabi-gcc3"' # ... and here.
if '-march=armv7' in CONFIG['OS_CFLAGS']:
DEFINES['MOZ_MIN_CPU_VERSION'] = 7
else:
DEFINES['MOZ_MIN_CPU_VERSION'] = 5
if CONFIG['MOZ_ANDROID_SEARCH_ACTIVITY']:
# The Search Activity is mostly independent of Fennec proper, but
# it does depend on Geckoview. Therefore, we build it as a jar
@ -1256,9 +1291,15 @@ if CONFIG['MOZ_ANDROID_SEARCH_ACTIVITY']:
'gecko-view.jar',
]
DEFINES['ANDROID_PACKAGE_NAME'] = CONFIG['ANDROID_PACKAGE_NAME']
FINAL_TARGET_PP_FILES += ['package-name.txt.in']
DEFINES['OBJDIR'] = OBJDIR
DEFINES['TOPOBJDIR'] = TOPOBJDIR
OBJDIR_PP_FILES.mobile.android.base += [
'AndroidManifest.xml.in',
]
gvjar.sources += ['generated/org/mozilla/gecko/' + x for x in [
'IGeckoEditableChild.java',
'IGeckoEditableParent.java',

Просмотреть файл

@ -1158,4 +1158,4 @@ static const TransportSecurityPreload kPublicKeyPinningPreloadList[] = {
static const int32_t kUnknownId = -1;
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1501253658399000);
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1501426532646000);

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -171,9 +171,7 @@ jobs:
- "mobile/android/**/*.png"
- "mobile/android/**/*.svg"
- "mobile/android/**/*.xml" # Manifest & android resources
- "mobile/android/**/*.gradle"
- "mobile/android/**/Makefile.in"
- "mobile/android/**/moz.build"
- "mobile/android/**/build.gradle"
android-checkstyle:
description: "Android checkstyle"
@ -222,10 +220,8 @@ jobs:
optimizations:
- - files-changed
- - "mobile/android/**/checkstyle.xml"
- "mobile/android/**/*.java"
- "mobile/android/**/*.gradle"
- "mobile/android/**/Makefile.in"
- "mobile/android/**/moz.build"
- "mobile/android/**/*.java"
android-findbugs:
description: "Android findbugs"
@ -273,7 +269,5 @@ jobs:
- docker-worker:relengapi-proxy:tooltool.download.public
optimizations:
- - files-changed
- - "mobile/android/**/*.java"
- "mobile/android/**/*.gradle"
- "mobile/android/**/Makefile.in"
- "mobile/android/**/moz.build"
- - "mobile/android/**/*.gradle"
- "mobile/android/**/*.java"

Просмотреть файл

@ -177,7 +177,7 @@ def target_tasks_graphics(full_task_graph, parameters):
def target_tasks_valgrind(full_task_graph, parameters):
"""Target tasks that only run on the cedar branch."""
def filter(task):
platform = task.attributes.get('test_platform').split('/')[0]
platform = task.attributes.get('test_platform')
if platform not in ['linux64']:
return False
@ -193,7 +193,7 @@ def target_tasks_valgrind(full_task_graph, parameters):
def target_tasks_code_coverage(full_task_graph, parameters):
"""Target tasks that generate coverage data."""
def filter(task):
platform = task.attributes.get('test_platform').split('/')[0]
platform = task.attributes.get('test_platform')
if platform not in ('linux64-ccov', 'linux64-jsdcov'):
return False
return True

Просмотреть файл

@ -31,13 +31,13 @@ def talos_task(n, tp):
}, {}))
tasks = {k: v for k, v in [
unittest_task('mochitest-browser-chrome', 'linux/opt'),
unittest_task('mochitest-browser-chrome-e10s', 'linux64/debug'),
unittest_task('mochitest-chrome', 'linux/this'),
unittest_task('mochitest-webgl', 'linux/that'),
unittest_task('crashtest-e10s', 'linux/other'),
unittest_task('gtest', 'linux64/asan'),
talos_task('dromaeojs', 'linux64/psan'),
unittest_task('mochitest-browser-chrome', 'linux'),
unittest_task('mochitest-browser-chrome-e10s', 'linux64'),
unittest_task('mochitest-chrome', 'linux'),
unittest_task('mochitest-webgl', 'linux'),
unittest_task('crashtest-e10s', 'linux'),
unittest_task('gtest', 'linux64'),
talos_task('dromaeojs', 'linux64'),
]}
unittest_tasks = {k: v for k, v in tasks.iteritems()
if 'unittest_try_name' in v.attributes}

Просмотреть файл

@ -679,7 +679,8 @@ def make_job_description(config, tests):
attributes.update({
'build_platform': attr_build_platform,
'build_type': attr_build_type,
'test_platform': test['test-platform'],
# only keep the first portion of the test platform
'test_platform': test['test-platform'].split('/')[0],
'test_chunk': str(test['this-chunk']),
'unittest_suite': suite,
'unittest_flavor': flavor,

Просмотреть файл

@ -121,7 +121,6 @@ UNITTEST_ALIASES = {
# [test_platforms]} translations, This includes only the most commonly-used
# substrings. This is intended only for backward-compatibility. New test
# platforms should have their `test_platform` spelled out fully in try syntax.
# Note that the test platforms here are only the prefix up to the `/`.
UNITTEST_PLATFORM_PRETTY_NAMES = {
'Ubuntu': ['linux32', 'linux64', 'linux64-asan'],
'x64': ['linux64', 'linux64-asan'],
@ -387,7 +386,7 @@ class TryOptionSyntax(object):
if test_arg is None or test_arg == 'none':
return []
all_platforms = set(t.attributes['test_platform'].split('/')[0]
all_platforms = set(t.attributes['test_platform']
for t in full_task_graph.tasks.itervalues()
if 'test_platform' in t.attributes)
@ -585,9 +584,7 @@ class TryOptionSyntax(object):
break
else:
return False
if 'platforms' in test:
platform = attributes.get('test_platform', '').split('/')[0]
if platform not in test['platforms']:
if 'platforms' in test and attr('test_platform') not in test['platforms']:
return False
if 'only_chunks' in test and attr('test_chunk') not in test['only_chunks']:
return False