Merge inbound to m-c

This commit is contained in:
Wes Kocher 2013-11-01 20:34:44 -07:00
commit e6e5c2e310
123 changed files with 813 additions and 856 deletions

View File

@ -18,4 +18,4 @@
# Modifying this file will now automatically clobber the buildbot machines \o/
#
Bug 918345 needs a clobber due to WebIDL binding dependency issues (bug 928195).
Bug 933120 needs a clobber because of bug 852814

View File

@ -186,7 +186,7 @@ interface nsIAccessiblePivotObserver : nsISupports
in PivotMoveReason aReason);
};
[scriptable, uuid(366fe92b-44c9-4769-ae40-7c2a075d3b16)]
[scriptable, uuid(4d9c4352-20f5-4c54-9580-0c77bb6b1115)]
interface nsIAccessibleTraversalRule : nsISupports
{
/* Ignore this accessible object */
@ -201,6 +201,7 @@ interface nsIAccessibleTraversalRule : nsISupports
const unsigned long PREFILTER_OFFSCREEN = 0x00000002;
const unsigned long PREFILTER_NOT_FOCUSABLE = 0x00000004;
const unsigned long PREFILTER_ARIA_HIDDEN = 0x00000008;
const unsigned long PREFILTER_TRANSPARENT = 0x00000010;
/**
* Pre-filter bitfield to filter out obviously ignorable nodes and lighten

View File

@ -169,6 +169,9 @@ void
SelectionManager::ProcessSelectionChanged(nsISelection* aSelection)
{
Selection* selection = static_cast<Selection*>(aSelection);
if (!selection->GetPresShell())
return;
const nsRange* range = selection->GetAnchorFocusRange();
nsINode* cntrNode = nullptr;
if (range)

View File

@ -875,6 +875,15 @@ RuleCache::ApplyFilter(Accessible* aAccessible, uint16_t* aResult)
return NS_OK;
}
}
if ((nsIAccessibleTraversalRule::PREFILTER_TRANSPARENT & mPreFilter) &&
!(state & states::OPAQUE1)) {
nsIFrame* frame = aAccessible->GetFrame();
if (frame->StyleDisplay()->mOpacity == 0.0f) {
*aResult |= nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE;
return NS_OK;
}
}
}
if (mAcceptRolesLength > 0) {

View File

@ -74,7 +74,8 @@ BaseTraversalRule.prototype = {
preFilter: Ci.nsIAccessibleTraversalRule.PREFILTER_DEFUNCT |
Ci.nsIAccessibleTraversalRule.PREFILTER_INVISIBLE |
Ci.nsIAccessibleTraversalRule.PREFILTER_ARIA_HIDDEN,
Ci.nsIAccessibleTraversalRule.PREFILTER_ARIA_HIDDEN |
Ci.nsIAccessibleTraversalRule.PREFILTER_TRANSPARENT,
match: function BaseTraversalRule_match(aAccessible)
{

View File

@ -5,6 +5,7 @@ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
const PREFILTER_INVISIBLE = nsIAccessibleTraversalRule.PREFILTER_INVISIBLE;
const PREFILTER_ARIA_HIDDEN = nsIAccessibleTraversalRule.PREFILTER_ARIA_HIDDEN;
const PREFILTER_TRANSPARENT = nsIAccessibleTraversalRule.PREFILTER_TRANSPARENT;
const FILTER_MATCH = nsIAccessibleTraversalRule.FILTER_MATCH;
const FILTER_IGNORE = nsIAccessibleTraversalRule.FILTER_IGNORE;
const FILTER_IGNORE_SUBTREE = nsIAccessibleTraversalRule.FILTER_IGNORE_SUBTREE;
@ -49,7 +50,7 @@ var ObjectTraversalRule =
return 0;
},
preFilter: PREFILTER_INVISIBLE | PREFILTER_ARIA_HIDDEN,
preFilter: PREFILTER_INVISIBLE | PREFILTER_ARIA_HIDDEN | PREFILTER_TRANSPARENT,
match: function(aAccessible)
{

View File

@ -18,6 +18,9 @@
<a href="#" id="hidden-link">Maybe</a> it was the other <i>George Michael</i>.
You know, the <a href="#">singer-songwriter</a>.
</p>
<p style="opacity: 0;" id="paragraph-4">
This is completely transparent
</p>
<iframe
src="data:text/html,<html><body>An <i>embedded</i> document.</body></html>">
</iframe>

View File

@ -795,7 +795,7 @@ pref("browser.safebrowsing.enabled", true);
pref("browser.safebrowsing.malware.enabled", true);
pref("browser.safebrowsing.debug", false);
pref("browser.safebrowsing.updateURL", "http://safebrowsing.clients.google.com/safebrowsing/downloads?client=SAFEBROWSING_ID&appver=%VERSION%&pver=2.2");
pref("browser.safebrowsing.updateURL", "http://safebrowsing.clients.google.com/safebrowsing/downloads?client=SAFEBROWSING_ID&appver=%VERSION%&pver=2.2&apikey=%GOOGLE_API_KEY%");
pref("browser.safebrowsing.keyURL", "https://sb-ssl.google.com/safebrowsing/newkey?client=SAFEBROWSING_ID&appver=%VERSION%&pver=2.2");
pref("browser.safebrowsing.gethashURL", "http://safebrowsing.clients.google.com/safebrowsing/gethash?client=SAFEBROWSING_ID&appver=%VERSION%&pver=2.2");
pref("browser.safebrowsing.reportURL", "http://safebrowsing.clients.google.com/safebrowsing/report?");
@ -806,11 +806,8 @@ pref("browser.safebrowsing.reportMalwareURL", "http://%LOCALE%.malware-report.mo
pref("browser.safebrowsing.reportMalwareErrorURL", "http://%LOCALE%.malware-error.mozilla.com/?hl=%LOCALE%");
pref("browser.safebrowsing.malware.reportURL", "http://safebrowsing.clients.google.com/safebrowsing/diagnostic?client=%NAME%&hl=%LOCALE%&site=");
// Since the application reputation query isn't hooked in anywhere yet, this
// preference does not matter. To be extra safe, don't turn this preference on
// for official builds without whitelisting (bug 842828).
#ifndef MOZILLA_OFFICIAL
pref("browser.safebrowsing.appRepURL", "https://sb-ssl.google.com/safebrowsing/clientreport/download");
pref("browser.safebrowsing.appRepURL", "https://sb-ssl.google.com/safebrowsing/clientreport/download&apikey=%GOOGLE_API_KEY%");
#endif
#ifdef MOZILLA_OFFICIAL

View File

@ -69,8 +69,11 @@ tests.push({
// Create a bookmarks.html in the profile.
let profileBookmarksHTMLFile = create_bookmarks_html("bookmarks.glue.html");
// Get file lastModified and size.
let lastMod = profileBookmarksHTMLFile.lastModifiedTime;
// set the file's lastModifiedTime to one minute ago and get its size.
let lastMod = Date.now() - 60*1000;
profileBookmarksHTMLFile.lastModifiedTime = lastMod;
let fileSize = profileBookmarksHTMLFile.fileSize;
// Force nsBrowserGlue::_shutdownPlaces().
@ -80,16 +83,8 @@ tests.push({
// Check a new bookmarks.html has been created.
let profileBookmarksHTMLFile = check_bookmarks_html();
//XXX not working on Linux unit boxes. Could be filestats caching issue.
let isLinux = ("@mozilla.org/gnome-gconf-service;1" in Cc);
if (!isLinux) {
//XXX this test does not working on Mac boxes as well.
let isOSX = ("nsILocalFileMac" in Ci);
if (!isOSX) {
do_check_true(profileBookmarksHTMLFile.lastModifiedTime > lastMod);
}
do_check_neq(profileBookmarksHTMLFile.fileSize, fileSize);
}
do_check_true(profileBookmarksHTMLFile.lastModifiedTime > lastMod);
do_check_neq(profileBookmarksHTMLFile.fileSize, fileSize);
// Check preferences have not been reverted.
do_check_true(ps.getBoolPref(PREF_AUTO_EXPORT_HTML));

View File

@ -5,7 +5,6 @@
INTERNAL_TOOLS = 1
HOST_PROGRAM = elfhack
NO_PROFILE_GUIDED_OPTIMIZE = 1
VPATH += $(topsrcdir)/build

View File

@ -106,8 +106,6 @@ public:
default:
throw std::runtime_error("unsupported architecture");
}
if (!init)
file += "-noinit";
file += ".o";
std::ifstream inject(file.c_str(), std::ios::in|std::ios::binary);
elf = new Elf(inject);
@ -118,38 +116,26 @@ public:
ElfSymtab_Section *symtab = NULL;
// Get all executable sections from the injected code object.
// Most of the time, there will only be one for the init function,
// but on e.g. x86, there is a separate section for
// __i686.get_pc_thunk.$reg
// Find the symbol table at the same time.
// Find the symbol table.
for (ElfSection *section = elf->getSection(1); section != NULL;
section = section->getNext()) {
if ((section->getType() == SHT_PROGBITS) &&
(section->getFlags() & SHF_EXECINSTR)) {
code.push_back(section);
// We need to align this section depending on the greater
// alignment required by code sections.
if (shdr.sh_addralign < section->getAddrAlign())
shdr.sh_addralign = section->getAddrAlign();
} else if (section->getType() == SHT_SYMTAB) {
if (section->getType() == SHT_SYMTAB)
symtab = (ElfSymtab_Section *) section;
}
}
assert(code.size() != 0);
if (symtab == NULL)
throw std::runtime_error("Couldn't find a symbol table for the injected code");
// Find the init symbol
entry_point = -1;
int shndx = 0;
Elf_SymValue *sym = symtab->lookup("init");
if (sym) {
entry_point = sym->value.getValue();
shndx = sym->value.getSection()->getIndex();
} else
Elf_SymValue *sym = symtab->lookup(init ? "init" : "init_noinit");
if (!sym)
throw std::runtime_error("Couldn't find an 'init' symbol in the injected code");
entry_point = sym->value.getValue();
// Get all relevant sections from the injected code object.
add_code_section(sym->value.getSection());
// Adjust code sections offsets according to their size
std::vector<ElfSection *>::iterator c = code.begin();
(*c)->getShdr().sh_addr = 0;
@ -158,6 +144,10 @@ public:
if (addr & ((*c)->getAddrAlign() - 1))
addr = (addr | ((*c)->getAddrAlign() - 1)) + 1;
(*c)->getShdr().sh_addr = addr;
// We need to align this section depending on the greater
// alignment required by code sections.
if (shdr.sh_addralign < (*c)->getAddrAlign())
shdr.sh_addralign = (*c)->getAddrAlign();
}
shdr.sh_size = code.back()->getAddr() + code.back()->getSize();
data = new char[shdr.sh_size];
@ -165,8 +155,6 @@ public:
for (c = code.begin(); c != code.end(); c++) {
memcpy(buf, (*c)->getData(), (*c)->getSize());
buf += (*c)->getSize();
if ((*c)->getIndex() < shndx)
entry_point += (*c)->getSize();
}
name = elfhack_text;
}
@ -182,14 +170,15 @@ public:
(*c)->getShdr().sh_addr += getAddr();
// Apply relocations
for (ElfSection *rel = elf->getSection(1); rel != NULL; rel = rel->getNext())
if ((rel->getType() == SHT_REL) || (rel->getType() == SHT_RELA)) {
ElfSection *section = rel->getInfo().section;
if ((section->getType() == SHT_PROGBITS) && (section->getFlags() & SHF_EXECINSTR)) {
for (std::vector<ElfSection *>::iterator c = code.begin(); c != code.end(); c++) {
for (ElfSection *rel = elf->getSection(1); rel != NULL; rel = rel->getNext())
if (((rel->getType() == SHT_REL) ||
(rel->getType() == SHT_RELA)) &&
(rel->getInfo().section == *c)) {
if (rel->getType() == SHT_REL)
apply_relocations((ElfRel_Section<Elf_Rel> *)rel, section);
apply_relocations((ElfRel_Section<Elf_Rel> *)rel, *c);
else
apply_relocations((ElfRel_Section<Elf_Rela> *)rel, section);
apply_relocations((ElfRel_Section<Elf_Rela> *)rel, *c);
}
}
@ -204,6 +193,48 @@ public:
return entry_point;
}
private:
void add_code_section(ElfSection *section)
{
if (section) {
code.push_back(section);
find_code(section);
}
}
/* Look at the relocations associated to the given section to find other
* sections that it requires */
void find_code(ElfSection *section)
{
for (ElfSection *s = elf->getSection(1); s != NULL;
s = s->getNext()) {
if (((s->getType() == SHT_REL) ||
(s->getType() == SHT_RELA)) &&
(s->getInfo().section == section)) {
if (s->getType() == SHT_REL)
scan_relocs_for_code((ElfRel_Section<Elf_Rel> *)s);
else
scan_relocs_for_code((ElfRel_Section<Elf_Rela> *)s);
}
}
}
template <typename Rel_Type>
void scan_relocs_for_code(ElfRel_Section<Rel_Type> *rel)
{
ElfSymtab_Section *symtab = (ElfSymtab_Section *)rel->getLink();
for (auto r = rel->rels.begin(); r != rel->rels.end(); r++) {
ElfSection *section = symtab->syms[ELF32_R_SYM(r->r_info)].value.getSection();
if (section) {
for (ElfSection *s = elf->getSection(1); s != NULL; s = s->getNext()) {
if (section == s)
section = NULL;
break;
}
}
add_code_section(section);
}
}
class pc32_relocation {
public:
Elf32_Addr operator()(unsigned int base_addr, Elf32_Off offset,

View File

@ -22,7 +22,8 @@ extern __attribute__((visibility("hidden"))) void original_init(int argc, char *
extern __attribute__((visibility("hidden"))) Elf32_Rel relhack[];
extern __attribute__((visibility("hidden"))) Elf_Ehdr elf_header;
int init(int argc, char **argv, char **env)
static inline __attribute__((always_inline))
void do_relocations(void)
{
Elf32_Rel *rel;
Elf_Addr *ptr, *start;
@ -31,10 +32,20 @@ int init(int argc, char **argv, char **env)
for (ptr = start; ptr < &start[rel->r_info]; ptr++)
*ptr += (intptr_t)&elf_header;
}
}
#ifndef NOINIT
__attribute__((section(".text._init_noinit")))
int init_noinit(int argc, char **argv, char **env)
{
do_relocations();
return 0;
}
__attribute__((section(".text._init")))
int init(int argc, char **argv, char **env)
{
do_relocations();
original_init(argc, argv, env);
#endif
// Ensure there is no tail-call optimization, avoiding the use of the
// B.W instruction in Thumb for the call above.
return 0;

View File

@ -18,4 +18,3 @@ GARBAGE += $(CSRCS)
DEFINES += -DELFHACK_BUILD
CFLAGS := -O2 -fno-stack-protector $(filter -m% -I%,$(CFLAGS))
%-noinit.$(OBJ_SUFFIX): DEFINES += -DNOINIT

View File

@ -13,7 +13,6 @@ elif CONFIG['TARGET_CPU'].startswith('arm'):
else:
cpu = CONFIG['TARGET_CPU']
GENERATED_SOURCES += [ s % cpu for s in [
"%s-noinit.c",
"%s.c",
]]
GENERATED_SOURCES += [
"%s.c" % cpu,
]

View File

@ -21,3 +21,5 @@ HOST_SOURCES += [
'elf.cpp',
'elfhack.cpp',
]
HOST_PROGRAM = 'elfhack'

View File

@ -8,10 +8,6 @@
# libstdc++-compat is not built yet.
MOZ_LIBSTDCXX_HOST_VERSION =
ifneq (WINNT,$(HOST_OS_ARCH))
HOST_PROGRAM = nsinstall_real$(HOST_BIN_SUFFIX)
endif
ifndef CROSS_COMPILE
ifdef USE_ELF_DYNSTR_GC
export:: elf-dynstr-gc

View File

@ -49,6 +49,8 @@ _MOZBUILD_EXTERNAL_VARIABLES := \
HOST_CSRCS \
HOST_CMMSRCS \
HOST_LIBRARY_NAME \
HOST_PROGRAM \
HOST_SIMPLE_PROGRAMS \
IS_COMPONENT \
JAVA_JAR_TARGETS \
JS_MODULES_PATH \
@ -58,6 +60,7 @@ _MOZBUILD_EXTERNAL_VARIABLES := \
MSVC_ENABLE_PGO \
NO_DIST_INSTALL \
PARALLEL_DIRS \
PROGRAM \
SDK_HEADERS \
SIMPLE_PROGRAMS \
TEST_DIRS \
@ -397,10 +400,10 @@ NO_PROFILE_GUIDED_OPTIMIZE = 1
endif
# Enable profile-based feedback
ifndef NO_PROFILE_GUIDED_OPTIMIZE
ifneq (1,$(NO_PROFILE_GUIDED_OPTIMIZE))
ifdef MOZ_PROFILE_GENERATE
OS_CFLAGS += $(PROFILE_GEN_CFLAGS)
OS_CXXFLAGS += $(PROFILE_GEN_CFLAGS)
OS_CFLAGS += $(if $(filter $(notdir $<),$(notdir $(NO_PROFILE_GUIDED_OPTIMIZE))),,$(PROFILE_GEN_CFLAGS))
OS_CXXFLAGS += $(if $(filter $(notdir $<),$(notdir $(NO_PROFILE_GUIDED_OPTIMIZE))),,$(PROFILE_GEN_CFLAGS))
OS_LDFLAGS += $(PROFILE_GEN_LDFLAGS)
ifeq (WINNT,$(OS_ARCH))
AR_FLAGS += -LTCG
@ -408,8 +411,8 @@ endif
endif # MOZ_PROFILE_GENERATE
ifdef MOZ_PROFILE_USE
OS_CFLAGS += $(PROFILE_USE_CFLAGS)
OS_CXXFLAGS += $(PROFILE_USE_CFLAGS)
OS_CFLAGS += $(if $(filter $(notdir $<),$(notdir $(NO_PROFILE_GUIDED_OPTIMIZE))),,$(PROFILE_USE_CFLAGS))
OS_CXXFLAGS += $(if $(filter $(notdir $<),$(notdir $(NO_PROFILE_GUIDED_OPTIMIZE))),,$(PROFILE_USE_CFLAGS))
OS_LDFLAGS += $(PROFILE_USE_LDFLAGS)
ifeq (WINNT,$(OS_ARCH))
AR_FLAGS += -LTCG

View File

@ -23,3 +23,4 @@ if CONFIG['HOST_OS_ARCH'] != 'WINNT':
'nsinstall.c',
'pathsub.c',
]
HOST_PROGRAM = 'nsinstall_real'

View File

@ -28,7 +28,7 @@
#include "mozilla/layers/PCompositorChild.h"
#include "mozilla/net/NeckoChild.h"
#include "mozilla/Preferences.h"
#if defined(MOZ_CONTENT_SANDBOX) && defined(XP_UNIX)
#if defined(MOZ_CONTENT_SANDBOX) && defined(XP_UNIX) && !defined(XP_MACOSX)
#include "mozilla/Sandbox.h"
#endif
#include "mozilla/unused.h"
@ -571,7 +571,7 @@ ContentChild::RecvSetProcessPrivileges(const ChildPrivileges& aPrivs)
aPrivs;
// If this fails, we die.
SetCurrentProcessPrivileges(privs);
#if defined(MOZ_CONTENT_SANDBOX) && defined(XP_UNIX)
#if defined(MOZ_CONTENT_SANDBOX) && defined(XP_UNIX) && !defined(XP_MACOSX)
// SetCurrentProcessSandbox should be moved close to process initialization
// time if/when possible. SetCurrentProcessPrivileges should probably be
// moved as well. Right now this is set ONLY if we receive the

View File

@ -1,6 +0,0 @@
# -*- 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/.

View File

@ -1,6 +0,0 @@
# -*- 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/.

View File

@ -38,7 +38,9 @@ CXXFLAGS += $(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS) $(TK_CFLAGS)
ifdef _MSC_VER
ifeq ($(CPU_ARCH),x86_64)
# Workaround compiler bug (Bug 795594)
LayerTreeInvalidation.$(OBJ_SUFFIX): CXXFLAGS += -GL-
Layers.$(OBJ_SUFFIX): CXXFLAGS += -GL-
NO_PROFILE_GUIDED_OPTIMIZE := \
LayerTreeInvalidation.cpp \
Layers.cpp \
$(NULL)
endif
endif

View File

@ -626,7 +626,6 @@ imgStatusTracker::Difference(imgStatusTracker* aOther) const
MOZ_ASSERT(!mIsMultipart || aOther->mIsMultipart, "mIsMultipart should be monotonic");
diff.foundIsMultipart = !mIsMultipart && aOther->mIsMultipart;
MOZ_ASSERT(!mHadLastPart || aOther->mHadLastPart, "mHadLastPart should be monotonic");
diff.foundLastPart = !mHadLastPart && aOther->mHadLastPart;
diff.gotDecoded = !mHasBeenDecoded && aOther->mHasBeenDecoded;

View File

@ -4,16 +4,10 @@
# 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/.
sources = [
SIMPLE_PROGRAMS += [
'umaptable',
]
SOURCES += [
'%s.c' % s for s in sources
'%s.c' % s for s in SIMPLE_PROGRAMS
]
bin_suffix = CONFIG['BIN_SUFFIX']
SIMPLE_PROGRAMS += [
'%s%s' % (s, bin_suffix) for s in sources
]

View File

@ -13,7 +13,6 @@ SOURCES += [
'UnicharSelfTest.cpp',
]
bin_suffix = CONFIG['BIN_SUFFIX']
SIMPLE_PROGRAMS += [
"%s%s" % (fyl[0:-4], bin_suffix) for fyl in SOURCES
"%s" % (fyl[0:-4]) for fyl in SOURCES
]

View File

@ -258,14 +258,12 @@ GC(JSContext *cx,
#ifdef JS_GC_ZEAL
static bool
GCZeal(JSContext *cx,
unsigned argc,
JS::Value *vp)
GCZeal(JSContext *cx, unsigned argc, JS::Value *vp)
{
JS::Value* argv = JS_ARGV(cx, vp);
CallArgs args = CallArgsFromVp(argc, vp);
uint32_t zeal;
if (!JS_ValueToECMAUint32(cx, argv[0], &zeal))
if (!ToUint32(cx, args.get(0), &zeal))
return false;
JS_SetGCZeal(cx, uint8_t(zeal), JS_DEFAULT_ZEAL_FREQ);
@ -273,96 +271,6 @@ GCZeal(JSContext *cx,
}
#endif
#ifdef DEBUG
static bool
DumpHeap(JSContext *cx,
unsigned argc,
JS::Value *vp)
{
JSAutoByteString fileName;
void* startThing = nullptr;
JSGCTraceKind startTraceKind = JSTRACE_OBJECT;
void *thingToFind = nullptr;
size_t maxDepth = (size_t)-1;
void *thingToIgnore = nullptr;
FILE *dumpFile;
bool ok;
JS::Value *argv = JS_ARGV(cx, vp);
JS_SET_RVAL(cx, vp, JSVAL_VOID);
vp = argv + 0;
if (argc > 0 && *vp != JSVAL_NULL && *vp != JSVAL_VOID) {
JSString *str;
str = JS_ValueToString(cx, *vp);
if (!str)
return false;
*vp = STRING_TO_JSVAL(str);
if (!fileName.encodeLatin1(cx, str))
return false;
}
vp = argv + 1;
if (argc > 1 && *vp != JSVAL_NULL && *vp != JSVAL_VOID) {
if (!JSVAL_IS_TRACEABLE(*vp))
goto not_traceable_arg;
startThing = JSVAL_TO_TRACEABLE(*vp);
startTraceKind = JSVAL_TRACE_KIND(*vp);
}
vp = argv + 2;
if (argc > 2 && *vp != JSVAL_NULL && *vp != JSVAL_VOID) {
if (!JSVAL_IS_TRACEABLE(*vp))
goto not_traceable_arg;
thingToFind = JSVAL_TO_TRACEABLE(*vp);
}
vp = argv + 3;
if (argc > 3 && *vp != JSVAL_NULL && *vp != JSVAL_VOID) {
uint32_t depth;
if (!JS_ValueToECMAUint32(cx, *vp, &depth))
return false;
maxDepth = depth;
}
vp = argv + 4;
if (argc > 4 && *vp != JSVAL_NULL && *vp != JSVAL_VOID) {
if (!JSVAL_IS_TRACEABLE(*vp))
goto not_traceable_arg;
thingToIgnore = JSVAL_TO_TRACEABLE(*vp);
}
if (!fileName) {
dumpFile = stdout;
} else {
dumpFile = fopen(fileName.ptr(), "w");
if (!dumpFile) {
fprintf(stderr, "dumpHeap: can't open %s: %s\n",
fileName.ptr(), strerror(errno));
return false;
}
}
ok = JS_DumpHeap(JS_GetRuntime(cx), dumpFile, startThing, startTraceKind, thingToFind,
maxDepth, thingToIgnore);
if (dumpFile != stdout)
fclose(dumpFile);
if (!ok)
JS_ReportOutOfMemory(cx);
return ok;
not_traceable_arg:
fprintf(stderr,
"dumpHeap: argument %u is not null or a heap-allocated thing\n",
(unsigned)(vp - argv));
return false;
}
#endif /* DEBUG */
const JSFunctionSpec gGlobalFunctions[] =
{
JS_FS("print", Print, 0,0),
@ -375,9 +283,6 @@ const JSFunctionSpec gGlobalFunctions[] =
JS_FS("gc", GC, 0,0),
#ifdef JS_GC_ZEAL
JS_FS("gczeal", GCZeal, 1,0),
#endif
#ifdef DEBUG
JS_FS("dumpHeap", DumpHeap, 5,0),
#endif
JS_FS_END
};

View File

@ -33,13 +33,6 @@ FORCE_SHARED_LIB = 1
endif
DIST_INSTALL = 1
###############################################
# BEGIN include sources for low-level code shared with mfbt
#
MFBT_ROOT = $(srcdir)/../../mfbt
VPATH += $(MFBT_ROOT)
include $(MFBT_ROOT)/exported_headers.mk
VPATH += \
$(srcdir) \
$(srcdir)/builtin \
@ -133,8 +126,6 @@ endif
endif # JS_HAS_CTYPES
LOCAL_INCLUDES += -I$(MFBT_ROOT)/double-conversion
# PerfMeasurement is available regardless of low-level support for it;
# it just doesn't necessarily do anything useful. There is one
# implementation source file per supported operating system, plus a stub
@ -149,21 +140,12 @@ else
SDK_LIBRARY = $(SHARED_LIBRARY)
endif
ifeq (,$(MOZ_GLUE_PROGRAM_LDFLAGS))
# When building standalone, we need to include mfbt sources, and to declare
# "exported" mfbt symbols on its behalf when we use its headers.
include $(MFBT_ROOT)/sources.mk
DEFINES += -DIMPL_MFBT
endif
EXTRA_DSO_LDOPTS += $(NSPR_LIBS)
# Define keyword generator before rules.mk, see bug 323979 comment 50
HOST_SIMPLE_PROGRAMS += host_jskwgen$(HOST_BIN_SUFFIX)
GARBAGE += jsautokw.h host_jskwgen$(HOST_BIN_SUFFIX)
HOST_SIMPLE_PROGRAMS += host_jsoplengen$(HOST_BIN_SUFFIX)
GARBAGE += jsautooplen.h host_jsoplengen$(HOST_BIN_SUFFIX)
GARBAGE += selfhosted.out.h
@ -430,14 +412,18 @@ CFLAGS += -fp:precise
ifeq ($(CPU_ARCH),x86)
# Workaround compiler bug on PGO (Bug 721284)
MonoIC.$(OBJ_SUFFIX): CXXFLAGS += -GL-
Compiler.$(OBJ_SUFFIX): CXXFLAGS += -GL-
NO_PROFILE_GUIDED_OPTIMIZE := \
MonoIC.cpp \
Compiler.cpp \
$(NULL)
# Ditto (Bug 772303)
RegExp.$(OBJ_SUFFIX): CXXFLAGS += -GL-
NO_PROFILE_GUIDED_OPTIMIZE += RegExp.cpp
endif
# Ditto (Bug 810661)
ifeq ($(CPU_ARCH),x86_64)
CTypes.$(OBJ_SUFFIX): CXXFLAGS += -GL-
NO_PROFILE_GUIDED_OPTIMIZE := \
CTypes.cpp \
$(NULL)
endif
endif # _MSC_VER

View File

@ -269,18 +269,13 @@ static const struct ParamPair {
};
static bool
GCParameter(JSContext *cx, unsigned argc, jsval *vp)
GCParameter(JSContext *cx, unsigned argc, Value *vp)
{
JSString *str;
if (argc == 0) {
str = JS_ValueToString(cx, JSVAL_VOID);
JS_ASSERT(str);
} else {
str = JS_ValueToString(cx, vp[2]);
if (!str)
return false;
vp[2] = STRING_TO_JSVAL(str);
}
CallArgs args = CallArgsFromVp(argc, vp);
JSString *str = JS_ValueToString(cx, args.get(0));
if (!str)
return false;
JSFlatString *flatStr = JS_FlattenString(cx, str);
if (!flatStr)
@ -300,24 +295,23 @@ GCParameter(JSContext *cx, unsigned argc, jsval *vp)
}
JSGCParamKey param = paramMap[paramIndex].param;
if (argc == 1) {
// Request mode.
if (args.length() == 1) {
uint32_t value = JS_GetGCParameter(cx->runtime(), param);
vp[0] = JS_NumberValue(value);
args.rval().setNumber(value);
return true;
}
if (param == JSGC_NUMBER ||
param == JSGC_BYTES) {
if (param == JSGC_NUMBER || param == JSGC_BYTES) {
JS_ReportError(cx, "Attempt to change read-only parameter %s",
paramMap[paramIndex].name);
return false;
}
uint32_t value;
if (!JS_ValueToECMAUint32(cx, vp[3], &value)) {
JS_ReportError(cx,
"the second argument must be convertable to uint32_t "
"with non-zero value");
if (!ToUint32(cx, args[1], &value)) {
JS_ReportError(cx, "the second argument must be convertable to uint32_t "
"with non-zero value");
return false;
}
@ -333,12 +327,12 @@ GCParameter(JSContext *cx, unsigned argc, jsval *vp)
}
JS_SetGCParameter(cx->runtime(), param, value);
*vp = JSVAL_VOID;
args.rval().setUndefined();
return true;
}
static bool
IsProxy(JSContext *cx, unsigned argc, jsval *vp)
IsProxy(JSContext *cx, unsigned argc, Value *vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
if (argc != 1) {
@ -396,29 +390,33 @@ GCPreserveCode(JSContext *cx, unsigned argc, jsval *vp)
#ifdef JS_GC_ZEAL
static bool
GCZeal(JSContext *cx, unsigned argc, jsval *vp)
GCZeal(JSContext *cx, unsigned argc, Value *vp)
{
uint32_t zeal, frequency = JS_DEFAULT_ZEAL_FREQ;
CallArgs args = CallArgsFromVp(argc, vp);
if (argc > 2) {
if (args.length() > 2) {
RootedObject callee(cx, &args.callee());
ReportUsageError(cx, callee, "Too many arguments");
return false;
}
if (!JS_ValueToECMAUint32(cx, argc < 1 ? JSVAL_VOID : args[0], &zeal))
uint32_t zeal;
if (!ToUint32(cx, args.get(0), &zeal))
return false;
if (argc >= 2)
if (!JS_ValueToECMAUint32(cx, args[1], &frequency))
uint32_t frequency = JS_DEFAULT_ZEAL_FREQ;
if (args.length() >= 2) {
if (!ToUint32(cx, args.get(1), &frequency))
return false;
}
JS_SetGCZeal(cx, (uint8_t)zeal, frequency);
*vp = JSVAL_VOID;
args.rval().setUndefined();
return true;
}
static bool
ScheduleGC(JSContext *cx, unsigned argc, jsval *vp)
ScheduleGC(JSContext *cx, unsigned argc, Value *vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
@ -440,24 +438,24 @@ ScheduleGC(JSContext *cx, unsigned argc, jsval *vp)
PrepareZoneForGC(args[0].toString()->zone());
}
*vp = JSVAL_VOID;
args.rval().setUndefined();
return true;
}
static bool
SelectForGC(JSContext *cx, unsigned argc, jsval *vp)
SelectForGC(JSContext *cx, unsigned argc, Value *vp)
{
JSRuntime *rt = cx->runtime();
CallArgs args = CallArgsFromVp(argc, vp);
for (unsigned i = 0; i < argc; i++) {
Value arg(JS_ARGV(cx, vp)[i]);
if (arg.isObject()) {
if (!rt->gcSelectedForMarking.append(&arg.toObject()))
JSRuntime *rt = cx->runtime();
for (unsigned i = 0; i < args.length(); i++) {
if (args[i].isObject()) {
if (!rt->gcSelectedForMarking.append(&args[i].toObject()))
return false;
}
}
*vp = JSVAL_VOID;
args.rval().setUndefined();
return true;
}
@ -466,13 +464,14 @@ VerifyPreBarriers(JSContext *cx, unsigned argc, jsval *vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
if (argc) {
if (args.length() > 0) {
RootedObject callee(cx, &args.callee());
ReportUsageError(cx, callee, "Too many arguments");
return false;
}
gc::VerifyBarriers(cx->runtime(), gc::PreBarrierVerifier);
*vp = JSVAL_VOID;
args.rval().setUndefined();
return true;
}
@ -536,27 +535,27 @@ DeterministicGC(JSContext *cx, unsigned argc, jsval *vp)
#endif /* JS_GC_ZEAL */
static bool
GCSlice(JSContext *cx, unsigned argc, jsval *vp)
GCSlice(JSContext *cx, unsigned argc, Value *vp)
{
bool limit = true;
uint32_t budget = 0;
CallArgs args = CallArgsFromVp(argc, vp);
if (argc > 1) {
if (args.length() > 1) {
RootedObject callee(cx, &args.callee());
ReportUsageError(cx, callee, "Wrong number of arguments");
return false;
}
if (argc == 1) {
if (!JS_ValueToECMAUint32(cx, args[0], &budget))
bool limit = true;
uint32_t budget = 0;
if (args.length() == 1) {
if (!ToUint32(cx, args[0], &budget))
return false;
} else {
limit = false;
}
GCDebugSlice(cx->runtime(), limit, budget);
*vp = JSVAL_VOID;
args.rval().setUndefined();
return true;
}
@ -565,14 +564,14 @@ ValidateGC(JSContext *cx, unsigned argc, jsval *vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
if (argc != 1) {
if (args.length() != 1) {
RootedObject callee(cx, &args.callee());
ReportUsageError(cx, callee, "Wrong number of arguments");
return false;
}
gc::SetValidateGC(cx, ToBoolean(vp[2]));
*vp = JSVAL_VOID;
gc::SetValidateGC(cx, ToBoolean(args[0]));
args.rval().setUndefined();
return true;
}
@ -581,14 +580,14 @@ FullCompartmentChecks(JSContext *cx, unsigned argc, jsval *vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
if (argc != 1) {
if (args.length() != 1) {
RootedObject callee(cx, &args.callee());
ReportUsageError(cx, callee, "Wrong number of arguments");
return false;
}
gc::SetFullCompartmentChecks(cx, ToBoolean(vp[2]));
*vp = JSVAL_VOID;
gc::SetFullCompartmentChecks(cx, ToBoolean(args[0]));
args.rval().setUndefined();
return true;
}

View File

@ -3,10 +3,6 @@
# 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/.
ifneq (WINNT,$(HOST_OS_ARCH))
HOST_PROGRAM = nsinstall_real$(HOST_BIN_SUFFIX)
endif
# IMPORTANT: Disable NSBUILDROOT for this directory only, otherwise we have
# a recursive rule for finding nsinstall and the Perl scripts.
ifdef NSBUILDROOT

View File

@ -49,6 +49,8 @@ _MOZBUILD_EXTERNAL_VARIABLES := \
HOST_CSRCS \
HOST_CMMSRCS \
HOST_LIBRARY_NAME \
HOST_PROGRAM \
HOST_SIMPLE_PROGRAMS \
IS_COMPONENT \
JAVA_JAR_TARGETS \
JS_MODULES_PATH \
@ -58,6 +60,7 @@ _MOZBUILD_EXTERNAL_VARIABLES := \
MSVC_ENABLE_PGO \
NO_DIST_INSTALL \
PARALLEL_DIRS \
PROGRAM \
SDK_HEADERS \
SIMPLE_PROGRAMS \
TEST_DIRS \
@ -397,10 +400,10 @@ NO_PROFILE_GUIDED_OPTIMIZE = 1
endif
# Enable profile-based feedback
ifndef NO_PROFILE_GUIDED_OPTIMIZE
ifneq (1,$(NO_PROFILE_GUIDED_OPTIMIZE))
ifdef MOZ_PROFILE_GENERATE
OS_CFLAGS += $(PROFILE_GEN_CFLAGS)
OS_CXXFLAGS += $(PROFILE_GEN_CFLAGS)
OS_CFLAGS += $(if $(filter $(notdir $<),$(notdir $(NO_PROFILE_GUIDED_OPTIMIZE))),,$(PROFILE_GEN_CFLAGS))
OS_CXXFLAGS += $(if $(filter $(notdir $<),$(notdir $(NO_PROFILE_GUIDED_OPTIMIZE))),,$(PROFILE_GEN_CFLAGS))
OS_LDFLAGS += $(PROFILE_GEN_LDFLAGS)
ifeq (WINNT,$(OS_ARCH))
AR_FLAGS += -LTCG
@ -408,8 +411,8 @@ endif
endif # MOZ_PROFILE_GENERATE
ifdef MOZ_PROFILE_USE
OS_CFLAGS += $(PROFILE_USE_CFLAGS)
OS_CXXFLAGS += $(PROFILE_USE_CFLAGS)
OS_CFLAGS += $(if $(filter $(notdir $<),$(notdir $(NO_PROFILE_GUIDED_OPTIMIZE))),,$(PROFILE_USE_CFLAGS))
OS_CXXFLAGS += $(if $(filter $(notdir $<),$(notdir $(NO_PROFILE_GUIDED_OPTIMIZE))),,$(PROFILE_USE_CFLAGS))
OS_LDFLAGS += $(PROFILE_USE_LDFLAGS)
ifeq (WINNT,$(OS_ARCH))
AR_FLAGS += -LTCG

View File

@ -19,3 +19,4 @@ if CONFIG['HOST_OS_ARCH'] != 'WINNT':
'nsinstall.c',
'pathsub.c',
]
HOST_PROGRAM = 'nsinstall_real'

View File

@ -2970,6 +2970,19 @@ MOZ_ARG_HEADER(Application)
ENABLE_TESTS=1
dnl ========================================================
dnl Tell the build system that ../../mfbt exists outside
dnl the source tree, but files from there are included from
dnl inside the tree.
dnl
dnl This should probably be a --with-external-source-dir
dnl option, like the root mozilla-central configure, but
dnl then anyone building the standalone js shell would need
dnl to remember to pass it, and it is only used in one file.
dnl ========================================================
EXTERNAL_SOURCE_DIR=../../mfbt
AC_SUBST(EXTERNAL_SOURCE_DIR)
USE_ARM_KUSER=
case "${target}" in

View File

@ -1,6 +0,0 @@
# -*- 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/.

View File

@ -1,6 +0,0 @@
# -*- 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/.

View File

@ -1,6 +0,0 @@
# -*- 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/.

View File

@ -1,6 +0,0 @@
# -*- 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/.

View File

@ -0,0 +1,5 @@
// |jit-test| error: InternalError
var g = newGlobal();
var dbg = new Debugger(g);
g.eval("function f(n) { if (n == 0) debugger; else f(n - 1); }");
g.f("function f() { debugger; }");

View File

@ -286,8 +286,29 @@ BaselineCompiler::emitPrologue()
else
masm.storePtr(R1.scratchReg(), frame.addressOfScopeChain());
if (!emitStackCheck())
return false;
// Functions with a large number of locals require two stack checks.
// The VMCall for a fallible stack check can only occur after the
// scope chain has been initialized, as that is required for proper
// exception handling if the VMCall returns false. The scope chain
// initialization can only happen after the UndefinedValues for the
// local slots have been pushed.
// However by that time, the stack might have grown too much.
// In these cases, we emit an extra, early, infallible check
// before pushing the locals. The early check sets a flag on the
// frame if the stack check fails (but otherwise doesn't throw an
// exception). If the flag is set, then the jitcode skips past
// the pushing of the locals, and directly to scope chain initialization
// followed by the actual stack check, which will throw the correct
// exception.
Label earlyStackCheckFailed;
if (needsEarlyStackCheck()) {
if (!emitStackCheck(/* earlyCheck = */ true))
return false;
masm.branchTest32(Assembler::NonZero,
frame.addressOfFlags(),
Imm32(BaselineFrame::OVER_RECURSED),
&earlyStackCheckFailed);
}
// Initialize locals to |undefined|. Use R0 to minimize code size.
// If the number of locals to push is < LOOP_UNROLL_FACTOR, then the
@ -319,6 +340,9 @@ BaselineCompiler::emitPrologue()
}
}
if (needsEarlyStackCheck())
masm.bind(&earlyStackCheckFailed);
#if JS_TRACE_LOGGING
masm.tracelogStart(script.get());
masm.tracelogLog(TraceLogging::INFO_ENGINE_BASELINE);
@ -333,6 +357,9 @@ BaselineCompiler::emitPrologue()
if (!initScopeChain())
return false;
if (!emitStackCheck())
return false;
if (!emitDebugPrologue())
return false;
@ -417,24 +444,52 @@ BaselineCompiler::emitIC(ICStub *stub, bool isForOp)
return true;
}
typedef bool (*CheckOverRecursedWithExtraFn)(JSContext *, uint32_t);
typedef bool (*CheckOverRecursedWithExtraFn)(JSContext *, BaselineFrame *, uint32_t, uint32_t);
static const VMFunction CheckOverRecursedWithExtraInfo =
FunctionInfo<CheckOverRecursedWithExtraFn>(CheckOverRecursedWithExtra);
bool
BaselineCompiler::emitStackCheck()
BaselineCompiler::emitStackCheck(bool earlyCheck)
{
Label skipCall;
uintptr_t *limitAddr = &cx->runtime()->mainThread.ionStackLimit;
uint32_t tolerance = script->nslots * sizeof(Value);
uint32_t slotsSize = script->nslots * sizeof(Value);
uint32_t tolerance = earlyCheck ? slotsSize : 0;
masm.movePtr(BaselineStackReg, R1.scratchReg());
masm.subPtr(Imm32(tolerance), R1.scratchReg());
// If this is the early stack check, locals haven't been pushed yet. Adjust the
// stack pointer to account for the locals that would be pushed before performing
// the guard around the vmcall to the stack check.
if (earlyCheck)
masm.subPtr(Imm32(tolerance), R1.scratchReg());
// If this is the late stack check for a frame which contains an early stack check,
// then the early stack check might have failed and skipped past the pushing of locals
// on the stack.
//
// If this is a possibility, then the OVER_RECURSED flag should be checked, and the
// VMCall to CheckOverRecursed done unconditionally if it's set.
Label forceCall;
if (!earlyCheck && needsEarlyStackCheck()) {
masm.branchTest32(Assembler::NonZero,
frame.addressOfFlags(),
Imm32(BaselineFrame::OVER_RECURSED),
&forceCall);
}
masm.branchPtr(Assembler::BelowOrEqual, AbsoluteAddress(limitAddr), R1.scratchReg(),
&skipCall);
if (!earlyCheck && needsEarlyStackCheck())
masm.bind(&forceCall);
prepareVMCall();
pushArg(Imm32(earlyCheck));
pushArg(Imm32(tolerance));
if (!callVM(CheckOverRecursedWithExtraInfo, /*preInitialize=*/true))
masm.loadBaselineFramePtr(BaselineFrameReg, R1.scratchReg());
pushArg(R1.scratchReg());
if (!callVM(CheckOverRecursedWithExtraInfo, /*preInitialize=*/earlyCheck))
return false;
masm.bind(&skipCall);

View File

@ -188,6 +188,13 @@ class BaselineCompiler : public BaselineCompilerSpecific
return &labels_[pc - script->code];
}
// If a script has more |nslots| than this, then emit code to do an
// early stack check.
static const unsigned EARLY_STACK_CHECK_SLOT_COUNT = 128;
bool needsEarlyStackCheck() const {
return script->nslots > EARLY_STACK_CHECK_SLOT_COUNT;
}
public:
BaselineCompiler(JSContext *cx, HandleScript script);
bool init();
@ -210,7 +217,7 @@ class BaselineCompiler : public BaselineCompilerSpecific
return emitIC(stub, false);
}
bool emitStackCheck();
bool emitStackCheck(bool earlyCheck=false);
bool emitInterruptCheck();
bool emitUseCountIncrement();
bool emitArgumentTypeChecks();

View File

@ -57,7 +57,10 @@ class BaselineFrame
HAS_HOOK_DATA = 1 << 7,
// Frame has profiler entry pushed.
HAS_PUSHED_SPS_FRAME = 1 << 8
HAS_PUSHED_SPS_FRAME = 1 << 8,
// Frame has over-recursed on an early check.
OVER_RECURSED = 1 << 9
};
protected: // Silence Clang warning about unused private fields.
@ -305,6 +308,14 @@ class BaselineFrame
flags_ &= ~HAS_PUSHED_SPS_FRAME;
}
bool overRecursed() const {
return flags_ & OVER_RECURSED;
}
void setOverRecursed() {
flags_ |= OVER_RECURSED;
}
void trace(JSTracer *trc);
bool isFunctionFrame() const {

View File

@ -9236,6 +9236,8 @@ ICUpdatedStub *
ICSetElemDenseAddCompiler::getStubSpecific(ICStubSpace *space, const AutoShapeVector *shapes)
{
RootedTypeObject objType(cx, obj_->getType(cx));
if (!objType)
return nullptr;
Rooted<IonCode *> stubCode(cx, getStubCode());
return ICSetElem_DenseAddImpl<ProtoChainDepth>::New(space, stubCode, objType, shapes);
}

View File

@ -1598,7 +1598,7 @@ CodeGenerator::visitPostWriteBarrierAllSlots(LPostWriteBarrierAllSlots *lir)
Register objreg = ToRegister(lir->object());
masm.branchPtr(Assembler::Below, objreg, ImmWord(nursery.start()), ool->entry());
masm.branchPtr(Assembler::Below, objreg, ImmWord(nursery.heapEnd()), ool->rejoin());
masm.branchPtr(Assembler::AboveOrEqual, objreg, ImmWord(nursery.heapEnd()), ool->entry());
masm.bind(ool->rejoin());
#endif
return true;

View File

@ -6303,9 +6303,14 @@ IonBuilder::setStaticName(JSObject *staticObject, PropertyName *name)
// If the property has a known type, we may be able to optimize typed stores by not
// storing the type tag.
MIRType slotType = MIRType_None;
JSValueType knownType = property.knownTypeTag(constraints());
if (knownType != JSVAL_TYPE_UNKNOWN)
slotType = MIRTypeFromValueType(knownType);
{
Shape *shape = staticObject->nativeLookup(cx, id);
if (!shape || !shape->hasSlot() || !staticObject->getSlot(shape->slot()).isUndefined()) {
JSValueType knownType = property.knownTypeTag(constraints());
if (knownType != JSVAL_TYPE_UNKNOWN)
slotType = MIRTypeFromValueType(knownType);
}
}
bool needsBarrier = property.needsBarrier(constraints());
return storeSlot(obj, property.maybeTypes()->definiteSlot(), NumFixedSlots(staticObject),

View File

@ -128,14 +128,36 @@ CheckOverRecursed(JSContext *cx)
return true;
}
// This function can get called in two contexts. In the usual context, it's
// called with ealyCheck=false, after the scope chain has been initialized on
// a baseline frame. In this case, it's ok to throw an exception, so a failed
// stack check returns false, and a successful stack check promps a check for
// an interrupt from the runtime, which may also cause a false return.
//
// In the second case, it's called with earlyCheck=true, prior to frame
// initialization. An exception cannot be thrown in this instance, so instead
// an error flag is set on the frame and true returned.
bool
CheckOverRecursedWithExtra(JSContext *cx, uint32_t extra)
CheckOverRecursedWithExtra(JSContext *cx, BaselineFrame *frame,
uint32_t extra, uint32_t earlyCheck)
{
JS_ASSERT_IF(earlyCheck, !frame->overRecursed());
// See |CheckOverRecursed| above. This is a variant of that function which
// accepts an argument holding the extra stack space needed for the Baseline
// frame that's about to be pushed.
uint8_t spDummy;
uint8_t *checkSp = (&spDummy) - extra;
if (earlyCheck) {
JS_CHECK_RECURSION_WITH_SP(cx, checkSp, frame->setOverRecursed());
return true;
}
// The OVERRECURSED flag may have already been set on the frame by an
// early over-recursed check. If so, throw immediately.
if (frame->overRecursed())
return false;
JS_CHECK_RECURSION_WITH_SP(cx, checkSp, return false);
if (cx->runtime()->interrupt)

View File

@ -570,7 +570,8 @@ JSObject *NewGCThing(JSContext *cx, gc::AllocKind allocKind, size_t thingSize,
gc::InitialHeap initialHeap);
bool CheckOverRecursed(JSContext *cx);
bool CheckOverRecursedWithExtra(JSContext *cx, uint32_t extra);
bool CheckOverRecursedWithExtra(JSContext *cx, BaselineFrame *frame,
uint32_t extra, uint32_t earlyCheck);
bool DefVarOrConst(JSContext *cx, HandlePropertyName dn, unsigned attrs, HandleObject scopeChain);
bool SetConst(JSContext *cx, HandlePropertyName name, HandleObject scopeChain, HandleValue rval);

View File

@ -253,7 +253,7 @@ JS_ConvertArgumentsVA(JSContext *cx, unsigned argc, jsval *argv, const char *for
return false;
break;
case 'u':
if (!JS_ValueToECMAUint32(cx, *sp, va_arg(ap, uint32_t *)))
if (!ToUint32(cx, arg, va_arg(ap, uint32_t *)))
return false;
break;
case 'j':
@ -447,14 +447,6 @@ JS_DoubleToUint32(double d)
return ToUint32(d);
}
JS_PUBLIC_API(bool)
JS_ValueToECMAUint32(JSContext *cx, jsval valueArg, uint32_t *ip)
{
RootedValue value(cx, valueArg);
return JS::ToUint32(cx, value, ip);
}
JS_PUBLIC_API(bool)
JS_ValueToInt64(JSContext *cx, jsval valueArg, int64_t *ip)
{

View File

@ -1107,13 +1107,6 @@ JS_DoubleToInt32(double d);
extern JS_PUBLIC_API(uint32_t)
JS_DoubleToUint32(double d);
/*
* Convert a value to a number, then to an int32_t, according to the ECMA rules
* for ToInt32.
*/
extern JS_PUBLIC_API(bool)
JS_ValueToECMAInt32(JSContext *cx, jsval v, int32_t *ip);
/*
* Convert a value to a number, then to an int64_t, according to the WebIDL
* rules for ToInt64: http://dev.w3.org/2006/webapi/WebIDL/#es-long-long
@ -1223,13 +1216,6 @@ ToUint64(JSContext *cx, JS::Handle<JS::Value> v, uint64_t *out)
} /* namespace JS */
/*
* Convert a value to a number, then to a uint32_t, according to the ECMA rules
* for ToUint32.
*/
extern JS_PUBLIC_API(bool)
JS_ValueToECMAUint32(JSContext *cx, jsval v, uint32_t *ip);
/*
* Convert a value to a number, then to an int32_t if it fits by rounding to
* nearest; but failing with an error report if the double is out of range

View File

@ -20,8 +20,15 @@ TEST_DIRS += ['jsapi-tests', 'tests', 'gdb']
MODULE = 'js'
mfbt_root = '../../mfbt'
LOCAL_INCLUDES += ['%s/double-conversion' % mfbt_root]
if CONFIG['JS_STANDALONE']:
LIBRARY_NAME = 'mozjs-%s' % CONFIG['MOZILLA_SYMBOLVERSION']
# When building standalone, we need to include mfbt sources, and to declare
# "exported" mfbt symbols on its behalf when we use its headers.
include('%s/common.mozbuild' % mfbt_root)
else:
LIBRARY_NAME = 'mozjs'
@ -362,4 +369,8 @@ HOST_SOURCES += [
'jsoplengen.cpp',
]
HOST_SIMPLE_PROGRAMS += [
'host_%s' % f.replace('.cpp', '') for f in HOST_SOURCES
]
FORCE_STATIC_LIB = True

View File

@ -978,7 +978,7 @@ Evaluate(JSContext *cx, unsigned argc, jsval *vp)
return false;
if (!JSVAL_IS_VOID(v)) {
uint32_t u;
if (!JS_ValueToECMAUint32(cx, v, &u))
if (!ToUint32(cx, v, &u))
return false;
lineNumber = u;
}
@ -1663,28 +1663,26 @@ static bool
LineToPC(JSContext *cx, unsigned argc, jsval *vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
RootedScript script(cx);
int32_t lineArg = 0;
uint32_t lineno;
jsbytecode *pc;
if (args.length() == 0) {
JS_ReportErrorNumber(cx, my_GetErrorMessage, nullptr, JSSMSG_LINE2PC_USAGE);
return false;
}
script = GetTopScript(cx);
jsval v = args[0];
if (!JSVAL_IS_PRIMITIVE(v) &&
JS_GetClass(&v.toObject()) == Jsvalify(&JSFunction::class_))
{
script = ValueToScript(cx, v);
RootedScript script(cx, GetTopScript(cx));
int32_t lineArg = 0;
if (args[0].isObject() && args[0].toObject().is<JSFunction>()) {
script = ValueToScript(cx, args[0]);
if (!script)
return false;
lineArg++;
}
if (!JS_ValueToECMAUint32(cx, args[lineArg], &lineno))
return false;
pc = JS_LineNumberToPC(cx, script, lineno);
uint32_t lineno;
if (!ToUint32(cx, args.get(lineArg), &lineno))
return false;
jsbytecode *pc = JS_LineNumberToPC(cx, script, lineno);
if (!pc)
return false;
args.rval().setInt32(pc - script->code);
@ -2190,107 +2188,76 @@ DumpHeap(JSContext *cx, unsigned argc, jsval *vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
jsval v;
void* startThing;
JSGCTraceKind startTraceKind;
const char *badTraceArg;
void *thingToFind;
size_t maxDepth;
void *thingToIgnore;
FILE *dumpFile;
bool ok;
JSAutoByteString fileName;
if (args.hasDefined(0)) {
RootedString str(cx, JS_ValueToString(cx, args[0]));
if (!str)
return false;
const char *fileName = nullptr;
JSAutoByteString fileNameBytes;
if (args.length() > 0) {
v = args[0];
if (!v.isNull()) {
JSString *str;
str = JS_ValueToString(cx, v);
if (!str)
return false;
args[0].setString(str);
if (!fileNameBytes.encodeLatin1(cx, str))
return false;
fileName = fileNameBytes.ptr();
}
if (!fileName.encodeLatin1(cx, str))
return false;
}
// Grab the depth param first, because JS_ValueToECMAUint32 can GC, and
// there's no easy way to root the traceable void* parameters below.
maxDepth = (size_t)-1;
if (args.length() > 3) {
v = args[3];
if (!v.isNull()) {
uint32_t depth;
if (!JS_ValueToECMAUint32(cx, v, &depth))
return false;
maxDepth = depth;
RootedValue startThing(cx);
if (args.hasDefined(1)) {
if (!args[1].isGCThing()) {
JS_ReportError(cx, "dumpHeap: Second argument not a GC thing!");
return false;
}
startThing = args[1];
}
startThing = nullptr;
startTraceKind = JSTRACE_OBJECT;
if (args.length() > 1) {
v = args[1];
if (v.isMarkable()) {
startThing = JSVAL_TO_TRACEABLE(v);
startTraceKind = v.gcKind();
} else if (!v.isNull()) {
badTraceArg = "start";
goto not_traceable_arg;
RootedValue thingToFind(cx);
if (args.hasDefined(2)) {
if (!args[2].isGCThing()) {
JS_ReportError(cx, "dumpHeap: Third argument not a GC thing!");
return false;
}
thingToFind = args[2];
}
thingToFind = nullptr;
if (args.length() > 2) {
v = args[2];
if (v.isMarkable()) {
thingToFind = JSVAL_TO_TRACEABLE(v);
} else if (!v.isNull()) {
badTraceArg = "toFind";
goto not_traceable_arg;
}
size_t maxDepth = size_t(-1);
if (args.hasDefined(3)) {
uint32_t depth;
if (!ToUint32(cx, args[3], &depth))
return false;
maxDepth = depth;
}
thingToIgnore = nullptr;
if (args.length() > 4) {
v = args[4];
if (v.isMarkable()) {
thingToIgnore = JSVAL_TO_TRACEABLE(v);
} else if (!v.isNull()) {
badTraceArg = "toIgnore";
goto not_traceable_arg;
RootedValue thingToIgnore(cx);
if (args.hasDefined(4)) {
if (!args[2].isGCThing()) {
JS_ReportError(cx, "dumpHeap: Fifth argument not a GC thing!");
return false;
}
thingToIgnore = args[4];
}
if (!fileName) {
dumpFile = stdout;
} else {
dumpFile = fopen(fileName, "w");
FILE *dumpFile = stdout;
if (fileName.length()) {
dumpFile = fopen(fileName.ptr(), "w");
if (!dumpFile) {
JS_ReportError(cx, "can't open %s: %s", fileName, strerror(errno));
JS_ReportError(cx, "dumpHeap: can't open %s: %s\n",
fileName.ptr(), strerror(errno));
return false;
}
}
ok = JS_DumpHeap(JS_GetRuntime(cx), dumpFile, startThing, startTraceKind, thingToFind,
maxDepth, thingToIgnore);
bool ok = JS_DumpHeap(JS_GetRuntime(cx), dumpFile,
startThing.isUndefined() ? nullptr : startThing.toGCThing(),
startThing.isUndefined() ? JSTRACE_OBJECT : startThing.get().gcKind(),
thingToFind.isUndefined() ? nullptr : thingToFind.toGCThing(),
maxDepth,
thingToIgnore.isUndefined() ? nullptr : thingToIgnore.toGCThing());
if (dumpFile != stdout)
fclose(dumpFile);
if (!ok) {
JS_ReportOutOfMemory(cx);
return false;
}
args.rval().setUndefined();
return true;
not_traceable_arg:
JS_ReportError(cx, "argument '%s' is not null or a heap-allocated thing",
badTraceArg);
return false;
if (!ok)
JS_ReportOutOfMemory(cx);
return ok;
}
static bool

View File

@ -4305,7 +4305,7 @@ DebuggerGenericEval(JSContext *cx, const char *fullMethodName, const Value &code
return false;
if (!v.isUndefined()) {
uint32_t lineno;
if (!JS_ValueToECMAUint32(cx, v, &lineno))
if (!ToUint32(cx, v, &lineno))
return false;
lineNumber = lineno;
}

View File

@ -1845,7 +1845,7 @@ struct MOZ_STACK_CLASS ExceptionArgParser
}
bool parseResult(HandleValue v) {
return JS_ValueToECMAUint32(cx, v, (uint32_t*) &eResult);
return JS::ToUint32(cx, v, (uint32_t*) &eResult);
}
bool parseStack(HandleValue v) {
@ -3687,8 +3687,9 @@ nsXPCComponents::SetProperty(nsIXPConnectWrappedNative *wrapper,
return NS_ERROR_FAILURE;
if (id == rt->GetStringID(XPCJSRuntime::IDX_RETURN_CODE)) {
RootedValue v(cx, *vp);
nsresult rv;
if (JS_ValueToECMAUint32(cx, *vp, (uint32_t*)&rv)) {
if (ToUint32(cx, v, (uint32_t*)&rv)) {
xpcc->SetPendingResult(rv);
xpcc->SetLastResult(rv);
return NS_SUCCESS_I_DID_SOMETHING;

View File

@ -417,104 +417,17 @@ GC(JSContext *cx, unsigned argc, jsval *vp)
static bool
GCZeal(JSContext *cx, unsigned argc, jsval *vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
uint32_t zeal;
if (!JS_ValueToECMAUint32(cx, argc ? JS_ARGV(cx, vp)[0] : JSVAL_VOID, &zeal))
if (!ToUint32(cx, args.get(0), &zeal))
return false;
JS_SetGCZeal(cx, uint8_t(zeal), JS_DEFAULT_ZEAL_FREQ);
JS_SET_RVAL(cx, vp, JSVAL_VOID);
args.rval().setUndefined();
return true;
}
#endif
#ifdef DEBUG
static bool
DumpHeap(JSContext *cx, unsigned argc, jsval *vp)
{
void* startThing = nullptr;
JSGCTraceKind startTraceKind = JSTRACE_OBJECT;
void *thingToFind = nullptr;
size_t maxDepth = (size_t)-1;
void *thingToIgnore = nullptr;
FILE *dumpFile;
bool ok;
jsval *argv = JS_ARGV(cx, vp);
JS_SET_RVAL(cx, vp, JSVAL_VOID);
vp = argv + 0;
JSAutoByteString fileName;
if (argc > 0 && *vp != JSVAL_NULL && *vp != JSVAL_VOID) {
JSString *str;
str = JS_ValueToString(cx, *vp);
if (!str)
return false;
*vp = STRING_TO_JSVAL(str);
if (!fileName.encodeLatin1(cx, str))
return false;
}
vp = argv + 1;
if (argc > 1 && *vp != JSVAL_NULL && *vp != JSVAL_VOID) {
if (!JSVAL_IS_TRACEABLE(*vp))
goto not_traceable_arg;
startThing = JSVAL_TO_TRACEABLE(*vp);
startTraceKind = JSVAL_TRACE_KIND(*vp);
}
vp = argv + 2;
if (argc > 2 && *vp != JSVAL_NULL && *vp != JSVAL_VOID) {
if (!JSVAL_IS_TRACEABLE(*vp))
goto not_traceable_arg;
thingToFind = JSVAL_TO_TRACEABLE(*vp);
}
vp = argv + 3;
if (argc > 3 && *vp != JSVAL_NULL && *vp != JSVAL_VOID) {
uint32_t depth;
if (!JS_ValueToECMAUint32(cx, *vp, &depth))
return false;
maxDepth = depth;
}
vp = argv + 4;
if (argc > 4 && *vp != JSVAL_NULL && *vp != JSVAL_VOID) {
if (!JSVAL_IS_TRACEABLE(*vp))
goto not_traceable_arg;
thingToIgnore = JSVAL_TO_TRACEABLE(*vp);
}
if (!fileName) {
dumpFile = gOutFile;
} else {
dumpFile = fopen(fileName.ptr(), "w");
if (!dumpFile) {
fprintf(gErrFile, "dumpHeap: can't open %s: %s\n",
fileName.ptr(), strerror(errno));
return false;
}
}
ok = JS_DumpHeap(JS_GetRuntime(cx), dumpFile, startThing, startTraceKind, thingToFind,
maxDepth, thingToIgnore);
if (dumpFile != gOutFile)
fclose(dumpFile);
if (!ok)
JS_ReportOutOfMemory(cx);
return ok;
not_traceable_arg:
fprintf(gErrFile,
"dumpHeap: argument %u is not null or a heap-allocated thing\n",
(unsigned)(vp - argv));
return false;
}
#endif /* DEBUG */
static bool
SendCommand(JSContext* cx,
unsigned argc,
@ -798,9 +711,6 @@ static const JSFunctionSpec glob_functions[] = {
#endif
JS_FS("options", Options, 0,0),
JS_FN("parent", Parent, 1,0),
#ifdef DEBUG
JS_FS("dumpHeap", DumpHeap, 5,0),
#endif
JS_FS("sendCommand", SendCommand, 1,0),
JS_FS("atob", Atob, 1,0),
JS_FS("btoa", Btoa, 1,0),

View File

@ -287,14 +287,14 @@ def write_getter(a, iface, fd):
fd.write(" aDict.%s = b;\n" % a.name)
elif realtype.count("uint16_t"):
fd.write(" uint32_t u;\n")
fd.write(" NS_ENSURE_STATE(JS_ValueToECMAUint32(aCx, v, &u));\n")
fd.write(" NS_ENSURE_STATE(JS::ToUint32(aCx, v, &u));\n")
fd.write(" aDict.%s = u;\n" % a.name)
elif realtype.count("int16_t"):
fd.write(" int32_t i;\n")
fd.write(" NS_ENSURE_STATE(JS::ToInt32(aCx, v, &i));\n")
fd.write(" aDict.%s = i;\n" % a.name)
elif realtype.count("uint32_t"):
fd.write(" NS_ENSURE_STATE(JS_ValueToECMAUint32(aCx, v, &aDict.%s));\n" % a.name)
fd.write(" NS_ENSURE_STATE(JS::ToUint32(aCx, v, &aDict.%s));\n" % a.name)
elif realtype.count("int32_t"):
fd.write(" NS_ENSURE_STATE(JS::ToInt32(aCx, v, &aDict.%s));\n" % a.name)
elif realtype.count("uint64_t"):

View File

@ -385,7 +385,7 @@ def substitute(template, vals):
argumentUnboxingTemplates = {
'octet':
" uint32_t ${name}_u32;\n"
" if (!JS_ValueToECMAUint32(cx, ${argVal}, &${name}_u32))\n"
" if (!JS::ToUint32(cx, ${argVal}, &${name}_u32))\n"
" return false;\n"
" uint8_t ${name} = (uint8_t) ${name}_u32;\n",
@ -397,7 +397,7 @@ argumentUnboxingTemplates = {
'unsigned short':
" uint32_t ${name}_u32;\n"
" if (!JS_ValueToECMAUint32(cx, ${argVal}, &${name}_u32))\n"
" if (!JS::ToUint32(cx, ${argVal}, &${name}_u32))\n"
" return false;\n"
" uint16_t ${name} = (uint16_t) ${name}_u32;\n",
@ -408,7 +408,7 @@ argumentUnboxingTemplates = {
'unsigned long':
" uint32_t ${name};\n"
" if (!JS_ValueToECMAUint32(cx, ${argVal}, &${name}))\n"
" if (!JS::ToUint32(cx, ${argVal}, &${name}))\n"
" return false;\n",
'long long':

View File

@ -376,8 +376,8 @@ select:disabled:disabled /* Need the pseudo-class twice to have the specificity
cursor: inherit;
}
input:disabled > .anonymous-div,
textarea:disabled > .anonymous-div {
input:disabled,
textarea:disabled {
cursor: default;
}

View File

@ -3,13 +3,6 @@
# 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/.
# Preserve until HOST_SIMPLE_PROGRAMS has been converted.
host_cppsrcs = \
ListCSSProperties.cpp \
$(NULL)
HOST_SIMPLE_PROGRAMS = $(addprefix host_, $(host_cppsrcs:.cpp=$(HOST_BIN_SUFFIX)))
# ParseCSS.cpp used to be built as a test program, but it was not
# being used for anything, and recent changes to the CSS loader have
# made it fail to link. Further changes are planned which should make

View File

@ -12,5 +12,9 @@ HOST_SOURCES += [
'ListCSSProperties.cpp',
]
HOST_SIMPLE_PROGRAMS += [
'host_%s' % f.replace('.cpp', '') for f in HOST_SOURCES
]
BROWSER_CHROME_MANIFESTS += ['browser.ini']

View File

@ -678,12 +678,6 @@ wasapi_stream_init(cubeb * context, cubeb_stream ** stream,
return CUBEB_ERROR;
}
/* 30ms in shared mode is the minimum we can get when using WASAPI */
if (latency < 30) {
LOG("Latency too low: got %u (30ms minimum)", latency);
return CUBEB_ERROR_INVALID_PARAMETER;
}
cubeb_stream * stm = (cubeb_stream *)calloc(1, sizeof(cubeb_stream));
assert(stm);

View File

@ -345,8 +345,6 @@ else
VPX_OIE_FORMAT := gas
endif
HOST_PROGRAM = host_obj_int_extract$(HOST_BIN_SUFFIX)
CSRCS += asm_com_offsets.c
GARBAGE += asm_com_offsets.$(OBJ_SUFFIX) asm_com_offsets.asm
@ -407,7 +405,7 @@ ifdef VPX_NEED_OBJ_INT_EXTRACT
# only for MSVC
ifdef _MSC_VER
asm_com_offsets.$(OBJ_SUFFIX): CFLAGS += -GL-
NO_PROFILE_GUIDED_OPTIMIZE := asm_com_offsets.c
endif
asm_com_offsets.asm: asm_com_offsets.$(OBJ_SUFFIX) $(HOST_PROGRAM)
@ -421,7 +419,7 @@ OBJS := $(filter-out asm_com_offsets.$(OBJ_SUFFIX),$(OBJS))
ifdef MOZ_VP8_ENCODER
ifdef _MSC_VER
asm_enc_offsets.$(OBJ_SUFFIX): CFLAGS += -GL-
NO_PROFILE_GUIDED_OPTIMIZE += asm_enc_offsets.c
endif
asm_enc_offsets.asm: asm_enc_offsets.$(OBJ_SUFFIX) $(HOST_PROGRAM)

View File

@ -36,6 +36,8 @@ if CONFIG['VPX_NEED_OBJ_INT_EXTRACT']:
'build/make/obj_int_extract.c',
]
HOST_PROGRAM = 'host_obj_int_extract'
LIBRARY_NAME = 'vpx'
SOURCES += [

View File

@ -63,8 +63,3 @@ INCLUDES += \
-I$(srcdir)/include/ics/media/stagefright/openmax \
$(NULL)
endif
libs:: $(DLL_PREFIX)$(LIBRARY_NAME)$(DLL_SUFFIX)
$(INSTALL) $< $(DEPTH)/dist/bin
libs:: $(PROGRAMS)

View File

@ -40,8 +40,3 @@ INCLUDES += \
-I$(srcdir)/../include/froyo \
-I$(srcdir)/../include/froyo/media/stagefright/openmax \
$(NULL)
libs:: $(DLL_PREFIX)$(LIBRARY_NAME)$(DLL_SUFFIX)
$(INSTALL) $< $(DEPTH)/dist/bin
libs:: $(PROGRAMS)

View File

@ -5,7 +5,6 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
MODULE = 'omxpluginfroyo'
NO_DIST_INSTALL = True
SOURCES += [
'OmxPluginFroyo.cpp',

View File

@ -40,8 +40,3 @@ INCLUDES += \
-I$(srcdir)/../include/gb \
-I$(srcdir)/../include/gb/media/stagefright/openmax \
$(NULL)
libs:: $(DLL_PREFIX)$(LIBRARY_NAME)$(DLL_SUFFIX)
$(INSTALL) $< $(DEPTH)/dist/bin
libs:: $(PROGRAMS)

View File

@ -5,7 +5,6 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
MODULE = 'omxplugingb'
NO_DIST_INSTALL = True
SOURCES += [
'OmxPlugin236.cpp',

View File

@ -40,8 +40,3 @@ INCLUDES += \
-I$(srcdir)/../include/gb \
-I$(srcdir)/../include/gb/media/stagefright/openmax \
$(NULL)
libs:: $(DLL_PREFIX)$(LIBRARY_NAME)$(DLL_SUFFIX)
$(INSTALL) $< $(DEPTH)/dist/bin
libs:: $(PROGRAMS)

View File

@ -5,7 +5,6 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
MODULE = 'omxplugingb235'
NO_DIST_INSTALL = True
SOURCES += [
'OmxPlugin235.cpp',

View File

@ -38,8 +38,3 @@ INCLUDES += \
-I$(srcdir)/../include/gb \
-I$(srcdir)/../include/gb/media/stagefright/openmax \
$(NULL)
libs:: $(DLL_PREFIX)$(LIBRARY_NAME)$(DLL_SUFFIX)
$(INSTALL) $< $(DEPTH)/dist/bin
libs:: $(PROGRAMS)

View File

@ -5,7 +5,6 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
MODULE = 'omxpluginhc'
NO_DIST_INSTALL = True
SOURCES += [
'OmxPluginHoneycomb.cpp',

View File

@ -15,7 +15,6 @@
# limitations under the License.
MODULE = 'omxplugin'
NO_DIST_INSTALL = True
SOURCES += [
'OmxPlugin.cpp',

View File

@ -111,6 +111,8 @@
'include_tests%': 0,
'enable_tracing%': 0,
# lazily allocate the ~4MB of trace message buffers if set
'enable_lazy_trace_alloc%': 0,
'enable_android_opensl%': 0,
}, { # Settings for the standalone (not-in-Chromium) build.

View File

@ -132,6 +132,11 @@
'trace_win.h',
],
}],
['enable_lazy_trace_alloc==0', {
'defines': [
'WEBRTC_LAZY_TRACE_ALLOC',
],
}],
['OS=="android" or moz_widget_toolkit_gonk==1', {
'defines': [
'WEBRTC_THREAD_RR',

View File

@ -88,8 +88,12 @@ TraceImpl::TraceImpl()
for (int m = 0; m < WEBRTC_TRACE_NUM_ARRAY; ++m) {
for (int n = 0; n < WEBRTC_TRACE_MAX_QUEUE; ++n) {
#if defined(WEBRTC_LAZY_TRACE_ALLOC)
message_queue_[m][n] = new
char[WEBRTC_TRACE_MAX_MESSAGE_SIZE];
#else
message_queue_[m][n] = NULL;
#endif
}
}
}
@ -340,6 +344,21 @@ int32_t TraceImpl::AddModuleAndId(char* trace_message,
int32_t TraceImpl::SetTraceFileImpl(const char* file_name_utf8,
const bool add_file_counter) {
#if !defined(WEBRTC_LAZY_TRACE_ALLOC)
if (file_name_utf8) {
// Lazy-allocate trace buffers to save memory.
// Avoid locking issues by not holding both critsects at once.
// Do this before we can return true from .Open().
CriticalSectionScoped lock(critsect_array_);
for (int m = 0; m < WEBRTC_TRACE_NUM_ARRAY; ++m) {
for (int n = 0; n < WEBRTC_TRACE_MAX_QUEUE; ++n) {
message_queue_[m][n] = new char[WEBRTC_TRACE_MAX_MESSAGE_SIZE];
}
}
}
#endif
CriticalSectionScoped lock(critsect_interface_);
trace_file_.Flush();
@ -424,7 +443,19 @@ void TraceImpl::AddMessageToList(
CriticalSectionScoped lock(critsect_array_);
if (next_free_idx_[active_queue_] >= WEBRTC_TRACE_MAX_QUEUE) {
uint16_t idx = next_free_idx_[active_queue_];
#if !defined(WEBRTC_LAZY_TRACE_ALLOC)
// Avoid grabbing another lock just to check Open(); use
// the fact we've allocated buffers to decide whether to save
// the message in the buffer. Use the indexing as this minimizes
// cache misses/etc
if (!message_queue_[active_queue_][idx]) {
return;
}
#endif
if (idx >= WEBRTC_TRACE_MAX_QUEUE) {
if (!trace_file_.Open() && !callback_) {
// Keep at least the last 1/4 of old messages when not logging.
// TODO(hellner): isn't this redundant. The user will make it known
@ -436,7 +467,7 @@ void TraceImpl::AddMessageToList(
message_queue_[active_queue_][n + last_quarter_offset],
WEBRTC_TRACE_MAX_MESSAGE_SIZE);
}
next_free_idx_[active_queue_] = WEBRTC_TRACE_MAX_QUEUE / 4;
idx = next_free_idx_[active_queue_] = WEBRTC_TRACE_MAX_QUEUE / 4;
} else {
// More messages are being written than there is room for in the
// buffer. Drop any new messages.
@ -449,7 +480,6 @@ void TraceImpl::AddMessageToList(
}
}
uint16_t idx = next_free_idx_[active_queue_];
next_free_idx_[active_queue_]++;
level_[active_queue_][idx] = level;

View File

@ -21,6 +21,8 @@
'use_system_libvpx': 0,
'build_libjpeg': 0,
'build_libvpx': 0,
# saves 4MB when webrtc_trace is off
'enable_lazy_trace_alloc': 1,
# turn off mandatory use of NEON and instead use NEON detection
'arm_neon': 0,

View File

@ -3,16 +3,3 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
STL_FLAGS =
# exported_headers.mk defines the headers exported by mfbt. It is included by
# mfbt itself and by the JS engine, which, when built standalone, must do the
# work to install mfbt's exported headers itself.
include $(srcdir)/exported_headers.mk
# sources.mk defines the source files built for mfbt. It is included by mfbt
# itself and by the JS engine, which, when built standalone, must do the work
# to build mfbt sources itself.
MFBT_ROOT = $(srcdir)
include $(MFBT_ROOT)/sources.mk
DEFINES += -DIMPL_MFBT

84
mfbt/common.mozbuild Normal file
View File

@ -0,0 +1,84 @@
# -*- 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/.
# This file defines the headers exported by and the sources build for mfbt.
# It is included by mfbt itself and by the JS engine, which, when built
# standalone, must install mfbt's exported headers and build mfbt sources
# itself. It expects that mfbt_root is set to the relative path to mfbt
# before this file in included.
mfbt_headers = [
'Alignment.h',
'AllocPolicy.h',
'Array.h',
'Assertions.h',
'Atomics.h',
'Attributes.h',
'BloomFilter.h',
'Casting.h',
'Char16.h',
'CheckedInt.h',
'Compiler.h',
'Compression.h',
'Constants.h',
'DebugOnly.h',
'decimal/Decimal.h',
'Endian.h',
'EnumSet.h',
'FloatingPoint.h',
'GuardObjects.h',
'HashFunctions.h',
'IntegerPrintfMacros.h',
'Likely.h',
'LinkedList.h',
'MathAlgorithms.h',
'Maybe.h',
'MemoryChecking.h',
'MemoryReporting.h',
'Move.h',
'MSIntTypes.h',
'NullPtr.h',
'NumericLimits.h',
'PodOperations.h',
'Poison.h',
'Range.h',
'RangedPtr.h',
'ReentrancyGuard.h',
'RefPtr.h',
'Scoped.h',
'SHA1.h',
'SplayTree.h',
'TemplateLib.h',
'ThreadLocal.h',
'TypedEnum.h',
'Types.h',
'TypeTraits.h',
'Util.h',
'Vector.h',
'WeakPtr.h',
]
mfbt_sources = [
'Compression.cpp',
'decimal/Decimal.cpp',
'double-conversion/bignum-dtoa.cc',
'double-conversion/bignum.cc',
'double-conversion/cached-powers.cc',
'double-conversion/diy-fp.cc',
'double-conversion/double-conversion.cc',
'double-conversion/fast-dtoa.cc',
'double-conversion/fixed-dtoa.cc',
'double-conversion/strtod.cc',
'FloatingPoint.cpp',
'HashFunctions.cpp',
'Poison.cpp',
'SHA1.cpp',
]
DEFINES['IMPL_MFBT'] = True
EXPORTS.mozilla += ['%s/%s' % (mfbt_root, header) for header in mfbt_headers]
SOURCES += ['%s/%s' % (mfbt_root, src) for src in mfbt_sources]

View File

@ -1,61 +0,0 @@
# 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/.
# This file defines the headers exported by mfbt. It is included by mfbt
# itself and by the JS engine, which, when built standalone, must install
# mfbt's exported headers itself.
EXPORTS_mozilla_DEST := $(DIST)/include/mozilla
EXPORTS_mozilla_TARGET := export
INSTALL_TARGETS += EXPORTS_mozilla
EXPORTS_mozilla_FILES += \
Alignment.h \
AllocPolicy.h \
Array.h \
Assertions.h \
Atomics.h \
Attributes.h \
BloomFilter.h \
Casting.h \
Char16.h \
CheckedInt.h \
Compiler.h \
Compression.h \
Constants.h \
DebugOnly.h \
decimal/Decimal.h \
Endian.h \
EnumSet.h \
FloatingPoint.h \
GuardObjects.h \
HashFunctions.h \
IntegerPrintfMacros.h \
Likely.h \
LinkedList.h \
MathAlgorithms.h \
Maybe.h \
MemoryChecking.h \
MemoryReporting.h \
MSIntTypes.h \
Move.h \
NullPtr.h \
NumericLimits.h \
PodOperations.h \
Poison.h \
Range.h \
RangedPtr.h \
ReentrancyGuard.h \
RefPtr.h \
Scoped.h \
SHA1.h \
SplayTree.h \
TemplateLib.h \
ThreadLocal.h \
TypedEnum.h \
Types.h \
TypeTraits.h \
Util.h \
Vector.h \
WeakPtr.h \
$(NULL)

View File

@ -11,3 +11,6 @@ MODULE = 'mozglue'
LIBRARY_NAME = 'mfbt'
FORCE_STATIC_LIB = True
mfbt_root = '.'
include('common.mozbuild')

View File

@ -1,39 +0,0 @@
# 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/.
ifndef MFBT_ROOT
$(error Before including this file, you must define MFBT_ROOT to point to \
the MFBT source directory)
endif
CPPSRCS += \
Compression.cpp \
FloatingPoint.cpp \
HashFunctions.cpp \
Poison.cpp \
SHA1.cpp \
$(NULL)
# Imported double-conversion sources.
VPATH += $(MFBT_ROOT)/double-conversion \
$(NULL)
CPPSRCS += \
bignum-dtoa.cc \
bignum.cc \
cached-powers.cc \
diy-fp.cc \
double-conversion.cc \
fast-dtoa.cc \
fixed-dtoa.cc \
strtod.cc \
$(NULL)
# Imported decimal sources.
VPATH += $(MFBT_ROOT)/decimal \
$(NULL)
CPPSRCS += \
Decimal.cpp

View File

@ -11,7 +11,6 @@ endif
# The mar executable is output into dist/host/bin since it is something that
# would only be used by our build system and should not itself be included in a
# Mozilla distribution.
HOST_PROGRAM = mar$(HOST_BIN_SUFFIX)
# Don't link the against libmozglue because we don't need it.
MOZ_GLUE_LDFLAGS =

View File

@ -13,3 +13,5 @@ SOURCES = [
'mar.c',
]
HOST_SOURCES += SOURCES
HOST_PROGRAM = 'mar'

View File

@ -4,8 +4,6 @@
STL_FLAGS =
HOST_PROGRAM = szip
HOST_LIBS = -lz
DEFINES += -DIMPL_MFBT

View File

@ -21,4 +21,6 @@ HOST_SOURCES += [
'szip.cpp',
]
HOST_PROGRAM = 'szip'
FORCE_STATIC_LIB = True

View File

@ -12,5 +12,5 @@ if CONFIG['MOZ_LINKER']:
'TestZip.cpp',
]
SIMPLE_PROGRAMS += [
'TestZip' + CONFIG['BIN_SUFFIX'],
'TestZip',
]

View File

@ -16,7 +16,7 @@ XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']
if CONFIG['OS_ARCH'] != 'Darwin':
XPCSHELL_TESTS_MANIFESTS += ['unit_ipc/xpcshell.ini']
sources = [
SIMPLE_PROGRAMS = [
'PropertiesTest',
'ReadNTLM',
'TestBlockingSocket',
@ -36,7 +36,7 @@ sources = [
]
# XXX Make this work in libxul builds.
#sources += [
#SIMPLE_PROGRAMS += [
# TestIDN',
# TestIOThreads',
# TestPerf',
@ -48,12 +48,7 @@ sources = [
#]
SOURCES += [
'%s.cpp' % s for s in sources
]
bin_suffix = CONFIG['BIN_SUFFIX']
SIMPLE_PROGRAMS += [
'%s%s' % (s, bin_suffix) for s in sources
'%s.cpp' % s for s in SIMPLE_PROGRAMS
]
CPP_UNIT_TESTS += [

View File

@ -24,7 +24,6 @@
# This program is output to dist/host/bin because it is only needed by the
# build system and is not intended to be included in Mozilla distributions.
HOST_PROGRAM = mbsdiff$(BIN_SUFFIX)
ifdef MOZ_NATIVE_BZ2
HOST_LIBS += $(MOZ_BZ2_LIBS)

View File

@ -7,3 +7,5 @@
HOST_SOURCES += [
'bsdiff.c',
]
HOST_PROGRAM = 'mbsdiff'

View File

@ -29,6 +29,8 @@ from ..frontend.data import (
GeneratedInclude,
GeneratedWebIDLFile,
HeaderFileSubstitution,
HostProgram,
HostSimpleProgram,
InstallationTarget,
IPDLFile,
JavaJarData,
@ -38,6 +40,7 @@ from ..frontend.data import (
Program,
SandboxDerived,
SandboxWrapped,
SimpleProgram,
TestWebIDLFile,
VariablePassthru,
XPIDLFile,
@ -413,6 +416,15 @@ class RecursiveMakeBackend(CommonBackend):
elif isinstance(obj, Program):
self._process_program(obj.program, backend_file)
elif isinstance(obj, HostProgram):
self._process_host_program(obj.program, backend_file)
elif isinstance(obj, SimpleProgram):
self._process_simple_program(obj.program, backend_file)
elif isinstance(obj, HostSimpleProgram):
self._process_host_simple_program(obj.program, backend_file)
elif isinstance(obj, TestManifest):
self._process_test_manifest(obj, backend_file)
@ -563,7 +575,8 @@ class RecursiveMakeBackend(CommonBackend):
unified_suffix='cpp',
extra_dependencies=[],
unified_files_makefile_variable='unified_files',
include_curdir_build_rules=True):
include_curdir_build_rules=True,
poison_windows_h=False):
files_per_unified_file = 16
explanation = "\n" \
@ -609,7 +622,15 @@ class RecursiveMakeBackend(CommonBackend):
# handle source files being added/removed/renamed. Therefore, we
# generate them here also to make sure everything's up-to-date.
with self._write_file(os.path.join(output_directory, unified_file)) as f:
f.write('\n'.join(['#include "%s"' % s for s in source_filenames]))
includeTemplate = '#include "%(cppfile)s"'
if poison_windows_h:
includeTemplate += (
'\n'
'#ifdef _WINDOWS_\n'
'#error "%(cppfile)s included windows.h"\n'
"#endif")
f.write('\n'.join(includeTemplate % { "cppfile": s } for
s in source_filenames))
if include_curdir_build_rules:
makefile.add_statement('\n'
@ -715,7 +736,8 @@ class RecursiveMakeBackend(CommonBackend):
self._add_unified_build_rules(mk, all_webidl_sources,
bindings_dir,
unified_prefix='UnifiedBindings',
unified_files_makefile_variable='unified_binding_cpp_files')
unified_files_makefile_variable='unified_binding_cpp_files',
poison_windows_h=True)
# Assume that Somebody Else has responsibility for correctly
# specifying removal dependencies for |all_webidl_sources|.
@ -958,6 +980,15 @@ class RecursiveMakeBackend(CommonBackend):
def _process_program(self, program, backend_file):
backend_file.write('PROGRAM = %s\n' % program)
def _process_host_program(self, program, backend_file):
backend_file.write('HOST_PROGRAM = %s\n' % program)
def _process_simple_program(self, program, backend_file):
backend_file.write('SIMPLE_PROGRAMS += %s\n' % program)
def _process_host_simple_program(self, program, backend_file):
backend_file.write('HOST_SIMPLE_PROGRAMS += %s\n' % program)
def _process_webidl_basename(self, basename):
header = 'mozilla/dom/%sBinding.h' % os.path.splitext(basename)[0]
self._install_manifests['dist_include'].add_optional_exists(header)

View File

@ -279,13 +279,14 @@ class GeneratedWebIDLFile(SandboxDerived):
self.basename = path
class Program(SandboxDerived):
"""Sandbox container object for PROGRAM, which is a unicode string.
class BaseProgram(SandboxDerived):
"""Sandbox container object for programs, which is a unicode string.
This class handles automatically appending BIN_SUFFIX to the PROGRAM value.
If BIN_SUFFIX is not defined, PROGRAM is unchanged.
Otherwise, if PROGRAM ends in BIN_SUFFIX, it is unchanged
Otherwise, BIN_SUFFIX is appended to PROGRAM
This class handles automatically appending a binary suffix to the program
name.
If the suffix is not defined, the program name is unchanged.
Otherwise, if the program name ends with the given suffix, it is unchanged
Otherwise, the suffix is appended to the program name.
"""
__slots__ = ('program')
@ -298,6 +299,22 @@ class Program(SandboxDerived):
self.program = program
class Program(BaseProgram):
"""Sandbox container object for PROGRAM"""
class HostProgram(BaseProgram):
"""Sandbox container object for HOST_PROGRAM"""
class SimpleProgram(BaseProgram):
"""Sandbox container object for each program in SIMPLE_PROGRAMS"""
class HostSimpleProgram(BaseProgram):
"""Sandbox container object for each program in HOST_SIMPLE_PROGRAMS"""
class TestManifest(SandboxDerived):
"""Represents a manifest file containing information about tests."""

View File

@ -26,6 +26,8 @@ from .data import (
GeneratedInclude,
GeneratedWebIDLFile,
HeaderFileSubstitution,
HostProgram,
HostSimpleProgram,
InstallationTarget,
IPDLFile,
LocalInclude,
@ -34,6 +36,7 @@ from .data import (
Program,
ReaderSummary,
SandboxWrapped,
SimpleProgram,
TestWebIDLFile,
TestManifest,
VariablePassthru,
@ -164,7 +167,6 @@ class TreeMetadataEmitter(LoggingMixin):
OS_LIBS='OS_LIBS',
SDK_LIBRARY='SDK_LIBRARY',
SHARED_LIBRARY_LIBS='SHARED_LIBRARY_LIBS',
SIMPLE_PROGRAMS='SIMPLE_PROGRAMS',
)
for mak, moz in varmap.items():
if sandbox[moz]:
@ -232,6 +234,16 @@ class TreeMetadataEmitter(LoggingMixin):
if program:
yield Program(sandbox, program, sandbox['CONFIG']['BIN_SUFFIX'])
program = sandbox.get('HOST_PROGRAM')
if program:
yield HostProgram(sandbox, program, sandbox['CONFIG']['HOST_BIN_SUFFIX'])
for program in sandbox['SIMPLE_PROGRAMS']:
yield SimpleProgram(sandbox, program, sandbox['CONFIG']['BIN_SUFFIX'])
for program in sandbox['HOST_SIMPLE_PROGRAMS']:
yield HostSimpleProgram(sandbox, program, sandbox['CONFIG']['HOST_BIN_SUFFIX'])
simple_lists = [
('GENERATED_EVENTS_WEBIDL_FILES', GeneratedEventWebIDLFile),
('GENERATED_WEBIDL_FILES', GeneratedWebIDLFile),

View File

@ -307,10 +307,25 @@ VARIABLES = {
""", None),
'SIMPLE_PROGRAMS': (StrictOrderingOnAppendList, list, [],
"""Generate a list of binaries from source.
"""Compile a list of executable names.
A list of sources, one per program, to compile & link with libs
into standalone programs.
Each name in this variable corresponds to an executable built from the
corresponding source file with the same base name.
If the configuration token ``BIN_SUFFIX`` is set, its value will be
automatically appended to each name. If a name already ends with
``BIN_SUFFIX``, the name will remain unchanged.
""", 'binaries'),
'HOST_SIMPLE_PROGRAMS': (StrictOrderingOnAppendList, list, [],
"""Compile a list of host executable names.
Each name in this variable corresponds to a hosst executable built
from the corresponding source file with the same base name.
If the configuration token ``HOST_BIN_SUFFIX`` is set, its value will
be automatically appended to each name. If a name already ends with
``HOST_BIN_SUFFIX``, the name will remain unchanged.
""", 'binaries'),
'TOOL_DIRS': (list, list, [],
@ -414,6 +429,14 @@ VARIABLES = {
``BIN_SUFFIX``, ``PROGRAM`` will remain unchanged.
""", 'binaries'),
'HOST_PROGRAM' : (unicode, unicode, "",
"""Compiled host executable name.
If the configuration token ``HOST_BIN_SUFFIX`` is set, its value will be
automatically appended to ``HOST_PROGRAM``. If ``HOST_PROGRAM`` already
ends with ``HOST_BIN_SUFFIX``, ``HOST_PROGRAM`` will remain unchanged.
""", 'binaries'),
'NO_DIST_INSTALL': (bool, bool, False,
"""Disable installing certain files into the distribution directory.

View File

@ -32,8 +32,6 @@ SDK_LIBRARY = ['bar.sdk', 'foo.sdk']
SHARED_LIBRARY_LIBS += ['bar.sll', 'foo.sll']
SIMPLE_PROGRAMS = ['bar.x', 'foo.x']
SOURCES += ['bar.c', 'foo.c']
SOURCES += ['bar.mm', 'foo.mm']

View File

@ -346,10 +346,6 @@ class TestRecursiveMakeBackend(BackendTester):
'SHARED_LIBRARY_LIBS += bar.sll',
'SHARED_LIBRARY_LIBS += foo.sll',
],
'SIMPLE_PROGRAMS': [
'SIMPLE_PROGRAMS += bar.x',
'SIMPLE_PROGRAMS += foo.x',
],
'SSRCS': [
'SSRCS += baz.S',
'SSRCS += foo.S',

View File

@ -2,3 +2,5 @@
# http://creativecommons.org/publicdomain/zero/1.0/
PROGRAM = 'test_program'
SIMPLE_PROGRAMS = [ 'test_program1', 'test_program2' ]

View File

@ -32,8 +32,6 @@ SDK_LIBRARY += ['fans.sdk', 'tans.sdk']
SHARED_LIBRARY_LIBS += ['fans.sll', 'tans.sll']
SIMPLE_PROGRAMS += ['fans.x', 'tans.x']
SOURCES += ['fans.c', 'tans.c']
SOURCES += ['fans.mm', 'tans.mm']

View File

@ -11,16 +11,17 @@ from mozunit import main
from mozbuild.frontend.data import (
ConfigFileSubstitution,
DirectoryTraversal,
ReaderSummary,
VariablePassthru,
Defines,
DirectoryTraversal,
Exports,
GeneratedInclude,
Program,
IPDLFile,
LocalInclude,
Program,
ReaderSummary,
SimpleProgram,
TestManifest,
VariablePassthru,
)
from mozbuild.frontend.emitter import TreeMetadataEmitter
from mozbuild.frontend.reader import (
@ -161,7 +162,6 @@ class TestEmitterBasic(unittest.TestCase):
OS_LIBS=['foo.so', '-l123', 'aaa.a'],
SDK_LIBRARY=['fans.sdk', 'tans.sdk'],
SHARED_LIBRARY_LIBS=['fans.sll', 'tans.sll'],
SIMPLE_PROGRAMS=['fans.x', 'tans.x'],
SSRCS=['bans.S', 'fans.S'],
VISIBILITY_FLAGS='',
)
@ -213,12 +213,15 @@ class TestEmitterBasic(unittest.TestCase):
reader = self.reader('program')
objs = self.read_topsrcdir(reader)
self.assertEqual(len(objs), 2)
self.assertEqual(len(objs), 4)
self.assertIsInstance(objs[0], DirectoryTraversal)
self.assertIsInstance(objs[1], Program)
self.assertIsInstance(objs[2], SimpleProgram)
self.assertIsInstance(objs[3], SimpleProgram)
program = objs[1].program
self.assertEqual(program, 'test_program.prog')
self.assertEqual(objs[1].program, 'test_program.prog')
self.assertEqual(objs[2].program, 'test_program1.prog')
self.assertEqual(objs[3].program, 'test_program2.prog')
def test_test_manifest_missing_manifest(self):
"""A missing manifest file should result in an error."""

View File

@ -8,15 +8,10 @@ MODULE = 'tlsserver'
FAIL_ON_WARNINGS = True
sources = [
SIMPLE_PROGRAMS = [
'OCSPStaplingServer',
]
SOURCES += [
'%s.cpp' % s for s in sources
]
bin_suffix = CONFIG['BIN_SUFFIX']
SIMPLE_PROGRAMS += [
'%s%s' % (s, bin_suffix) for s in sources
'%s.cpp' % s for s in SIMPLE_PROGRAMS
]

View File

@ -87,6 +87,10 @@ private:
};
static const char sStartupCacheName[] = "startupCache." SC_WORDSIZE "." SC_ENDIAN;
#if defined(XP_WIN) && defined(MOZ_METRO)
static const char sMetroStartupCacheName[] = "metroStartupCache." SC_WORDSIZE "." SC_ENDIAN;
#endif
static NS_DEFINE_CID(kZipReaderCID, NS_ZIPREADER_CID);
StartupCache*
@ -201,7 +205,14 @@ StartupCache::Init()
if (NS_FAILED(rv) && rv != NS_ERROR_FILE_ALREADY_EXISTS)
return rv;
rv = file->AppendNative(NS_LITERAL_CSTRING(sStartupCacheName));
#if defined(XP_WIN) && defined(MOZ_METRO)
if (XRE_GetWindowsEnvironment() == WindowsEnvironmentType_Metro) {
rv = file->AppendNative(NS_LITERAL_CSTRING(sMetroStartupCacheName));
} else
#endif
{
rv = file->AppendNative(NS_LITERAL_CSTRING(sStartupCacheName));
}
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -199,12 +199,6 @@ PendingLookup::SendRemoteQuery() {
nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(channel, &rv));
NS_ENSURE_SUCCESS(rv, rv);
// See bug 887044 for finalizing the user agent.
const nsCString userAgent = NS_LITERAL_CSTRING("CsdTesting/Mozilla");
rv = httpChannel->SetRequestHeader(
NS_LITERAL_CSTRING("User-Agent"), userAgent, false);
NS_ENSURE_SUCCESS(rv, rv);
// Upload the protobuf to the application reputation service.
nsCOMPtr<nsIUploadChannel2> uploadChannel = do_QueryInterface(channel, &rv);
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -343,7 +343,8 @@ TelemetryPing.prototype = {
"device", "manufacturer", "hardware",
"hasMMX", "hasSSE", "hasSSE2", "hasSSE3",
"hasSSSE3", "hasSSE4A", "hasSSE4_1", "hasSSE4_2",
"hasEDSP", "hasARMv6", "hasARMv7", "hasNEON", "isWow64"];
"hasEDSP", "hasARMv6", "hasARMv7", "hasNEON", "isWow64",
"profileHDDModel", "profileHDDRevision"];
for each (let field in fields) {
let value;
try {

Some files were not shown because too many files have changed in this diff Show More