Merge backout on a CLOSED TREE.

This commit is contained in:
Kyle Huey 2013-03-18 13:00:28 -07:00
commit 55e72000d4
31 changed files with 262 additions and 256 deletions

View File

@ -57,7 +57,6 @@ def InvokeClWithDependencyGeneration(cmdline):
f = open(depstarget, "w")
for dep in sorted(deps):
print >>f, "%s: %s" % (target, dep)
print >>f, "%s:" % dep
if __name__ == "__main__":
InvokeClWithDependencyGeneration(sys.argv[1:])

View File

@ -1,37 +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/.
import pymake.data
import pymake.parser
import pymake.parserdata
import sys
'''
Modifies the output of Sun Studio's -xM to look more like the output
of gcc's -MD -MP, adding phony targets for dependencies.
'''
def add_phony_targets(path):
print path
deps = set()
targets = set()
for stmt in pymake.parser.parsefile(path):
if isinstance(stmt, pymake.parserdata.Rule):
assert isinstance(stmt.depexp, pymake.data.StringExpansion)
assert isinstance(stmt.targetexp, pymake.data.StringExpansion)
for d in stmt.depexp.s.split():
deps.add(d)
for t in stmt.targetexp.s.split():
targets.add(t)
phony_targets = deps - targets
if not phony_targets:
return
with open(path, 'a') as f:
f.writelines('%s:\n' % d for d in phony_targets)
if __name__ == '__main__':
for f in sys.argv[1:]:
add_phony_targets(f)

View File

@ -329,9 +329,6 @@ def main():
with open(options.depend, 'w') as depfile:
depfile.write("%s : %s\n" % (options.target, ' '.join(dep for dep in deps if os.path.isfile(dep) and dep != options.target)))
for dep in deps:
if os.path.isfile(dep) and dep != options.target:
depfile.write("%s :\n" % dep)
if __name__ == '__main__':
main()

View File

@ -44,7 +44,4 @@ if __name__ == '__main__':
if options.depend:
ensureParentDir(options.depend)
with open(options.depend, 'w') as depfile:
deps = ExpandLibsDeps(args)
depfile.write("%s : %s\n" % (options.output, ' '.join(deps)))
for dep in deps:
depfile.write("%s :\n" % dep)
depfile.write("%s : %s\n" % (options.output, ' '.join(ExpandLibsDeps(args))))

View File

@ -986,19 +986,17 @@ define MAKE_DEPS_AUTO_CC
if test -d $(@D); then \
echo "Building deps for $< using Sun Studio cc"; \
$(CC) $(COMPILE_CFLAGS) -xM $< >$(_MDDEPFILE) ; \
$(PYTHON) $(topsrcdir)/build/unix/add_phony_targets.py $(_MDDEPFILE) ; \
fi
endef
define MAKE_DEPS_AUTO_CXX
if test -d $(@D); then \
echo "Building deps for $< using Sun Studio CC"; \
$(CXX) $(COMPILE_CXXFLAGS) -xM $< >$(_MDDEPFILE) ; \
$(PYTHON) $(topsrcdir)/build/unix/add_phony_targets.py $(_MDDEPFILE) ; \
fi
endef
endif # Sun Studio on Solaris
$(OBJS) $(HOST_OBJS) $(PROGOBJS) $(HOST_PROGOBJS): $(GLOBAL_DEPS)
$(OBJS) $(HOST_OBJS): $(GLOBAL_DEPS)
# Rules for building native targets must come first because of the host_ prefix
$(HOST_COBJS): host_%.$(OBJ_SUFFIX): %.c
@ -1615,7 +1613,14 @@ ifneq (,$(filter-out all chrome default export realchrome tools clean clobber cl
MDDEPEND_FILES := $(strip $(wildcard $(foreach file,$(OBJS) $(PROGOBJS) $(HOST_OBJS) $(HOST_PROGOBJS) $(TARGETS) $(XPIDLSRCS:.idl=.h) $(XPIDLSRCS:.idl=.xpt),$(MDDEPDIR)/$(notdir $(file)).pp) $(addprefix $(MDDEPDIR)/,$(EXTRA_MDDEPEND_FILES))))
ifneq (,$(MDDEPEND_FILES))
include $(MDDEPEND_FILES)
# The script mddepend.pl checks the dependencies and writes to stdout
# one rule to force out-of-date objects. For example,
# foo.o boo.o: FORCE
# The script has an advantage over including the *.pp files directly
# because it handles the case when header files are removed from the build.
# 'make' would complain that there is no way to build missing headers.
ALL_PP_RESULTS = $(shell $(PERL) $(BUILD_TOOLS)/mddepend.pl - $(MDDEPEND_FILES))
$(eval $(ALL_PP_RESULTS))
endif
endif

View File

@ -7935,7 +7935,7 @@ dnl ========================================================
MOZ_ARG_HEADER(Build dependencies)
if test "$GNU_CC" -a "$GNU_CXX"; then
_DEPEND_CFLAGS='-MD -MP -MF $(MDDEPDIR)/$(@F).pp'
_DEPEND_CFLAGS='$(filter-out %/.pp,-MD -MF $(MDDEPDIR)/$(@F).pp)'
dnl Sun Studio on Solaris use -xM instead of -MD, see config/rules.mk
elif test "$SOLARIS_SUNPRO_CC"; then
_DEPEND_CFLAGS=

View File

@ -38,7 +38,6 @@ public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_SVG_FE_COMPONENT_TRANSFER_FUNCTION_ELEMENT_CID)
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDOMSVGCOMPONENTTRANSFERFUNCTIONELEMENT
virtual bool AttributeAffectsRendering(
int32_t aNameSpaceID, nsIAtom* aAttribute) const;
@ -62,7 +61,6 @@ protected:
virtual EnumAttributesInfo GetEnumInfo();
virtual NumberListAttributesInfo GetNumberListInfo();
// nsIDOMSVGComponentTransferFunctionElement properties:
enum { TABLEVALUES };
SVGAnimatedNumberList mNumberListAttributes[1];
static NumberListInfo sNumberListInfo[1];
@ -87,7 +85,7 @@ namespace mozilla {
namespace dom {
class SVGFEFuncRElement : public SVGComponentTransferFunctionElement,
public nsIDOMSVGFEFuncRElement
public nsIDOMSVGElement
{
friend nsresult (::NS_NewSVGFEFuncRElement(
nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo));
@ -99,10 +97,6 @@ public:
// interfaces:
NS_DECL_ISUPPORTS_INHERITED
NS_FORWARD_NSIDOMSVGCOMPONENTTRANSFERFUNCTIONELEMENT(SVGComponentTransferFunctionElement::)
NS_DECL_NSIDOMSVGFEFUNCRELEMENT
virtual int32_t GetChannel() { return 0; }
NS_FORWARD_NSIDOMSVGELEMENT(SVGComponentTransferFunctionElement::)
@ -127,7 +121,7 @@ namespace mozilla {
namespace dom {
class SVGFEFuncGElement : public SVGComponentTransferFunctionElement,
public nsIDOMSVGFEFuncGElement
public nsIDOMSVGElement
{
friend nsresult (::NS_NewSVGFEFuncGElement(
nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo));
@ -139,10 +133,6 @@ public:
// interfaces:
NS_DECL_ISUPPORTS_INHERITED
NS_FORWARD_NSIDOMSVGCOMPONENTTRANSFERFUNCTIONELEMENT(SVGComponentTransferFunctionElement::)
NS_DECL_NSIDOMSVGFEFUNCGELEMENT
virtual int32_t GetChannel() { return 1; }
NS_FORWARD_NSIDOMSVGELEMENT(SVGComponentTransferFunctionElement::)
@ -167,7 +157,7 @@ namespace mozilla {
namespace dom {
class SVGFEFuncBElement : public SVGComponentTransferFunctionElement,
public nsIDOMSVGFEFuncBElement
public nsIDOMSVGElement
{
friend nsresult (::NS_NewSVGFEFuncBElement(
nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo));
@ -179,10 +169,6 @@ public:
// interfaces:
NS_DECL_ISUPPORTS_INHERITED
NS_FORWARD_NSIDOMSVGCOMPONENTTRANSFERFUNCTIONELEMENT(SVGComponentTransferFunctionElement::)
NS_DECL_NSIDOMSVGFEFUNCBELEMENT
virtual int32_t GetChannel() { return 2; }
NS_FORWARD_NSIDOMSVGELEMENT(SVGComponentTransferFunctionElement::)
@ -207,7 +193,7 @@ namespace mozilla {
namespace dom {
class SVGFEFuncAElement : public SVGComponentTransferFunctionElement,
public nsIDOMSVGFEFuncAElement
public nsIDOMSVGElement
{
friend nsresult (::NS_NewSVGFEFuncAElement(
nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo));
@ -219,10 +205,6 @@ public:
// interfaces:
NS_DECL_ISUPPORTS_INHERITED
NS_FORWARD_NSIDOMSVGCOMPONENTTRANSFERFUNCTIONELEMENT(SVGComponentTransferFunctionElement::)
NS_DECL_NSIDOMSVGFEFUNCAELEMENT
virtual int32_t GetChannel() { return 3; }
NS_FORWARD_NSIDOMSVGELEMENT(SVGComponentTransferFunctionElement::)

View File

@ -53,6 +53,13 @@
using namespace mozilla;
using namespace mozilla::dom;
static const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN = 0;
static const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY = 1;
static const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_TABLE = 2;
static const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE = 3;
static const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_LINEAR = 4;
static const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_GAMMA = 5;
void
CopyDataRect(uint8_t *aDest, const uint8_t *aSrc, uint32_t aStride,
const nsIntRect& aDataRect)
@ -1479,15 +1486,15 @@ nsSVGElement::NumberInfo SVGComponentTransferFunctionElement::sNumberInfo[5] =
nsSVGEnumMapping SVGComponentTransferFunctionElement::sTypeMap[] = {
{&nsGkAtoms::identity,
nsIDOMSVGComponentTransferFunctionElement::SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY},
SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY},
{&nsGkAtoms::table,
nsIDOMSVGComponentTransferFunctionElement::SVG_FECOMPONENTTRANSFER_TYPE_TABLE},
SVG_FECOMPONENTTRANSFER_TYPE_TABLE},
{&nsGkAtoms::discrete,
nsIDOMSVGComponentTransferFunctionElement::SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE},
SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE},
{&nsGkAtoms::linear,
nsIDOMSVGComponentTransferFunctionElement::SVG_FECOMPONENTTRANSFER_TYPE_LINEAR},
SVG_FECOMPONENTTRANSFER_TYPE_LINEAR},
{&nsGkAtoms::gamma,
nsIDOMSVGComponentTransferFunctionElement::SVG_FECOMPONENTTRANSFER_TYPE_GAMMA},
SVG_FECOMPONENTTRANSFER_TYPE_GAMMA},
{nullptr, 0}
};
@ -1495,7 +1502,7 @@ nsSVGElement::EnumInfo SVGComponentTransferFunctionElement::sEnumInfo[1] =
{
{ &nsGkAtoms::type,
sTypeMap,
nsIDOMSVGComponentTransferFunctionElement::SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY
SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY
}
};
@ -1534,92 +1541,49 @@ SVGComponentTransferFunctionElement::AttributeAffectsRendering(int32_t aNameSpac
}
//----------------------------------------------------------------------
// nsIDOMSVGComponentTransferFunctionElement methods
/* readonly attribute nsIDOMSVGAnimatedEnumeration type; */
already_AddRefed<nsIDOMSVGAnimatedEnumeration>
SVGComponentTransferFunctionElement::Type()
{
return mEnumAttributes[TYPE].ToDOMAnimatedEnum(this);
}
NS_IMETHODIMP SVGComponentTransferFunctionElement::GetType(nsIDOMSVGAnimatedEnumeration * *aType)
{
*aType = Type().get();
return NS_OK;
}
/* readonly attribute DOMSVGAnimatedNumberList tableValues; */
already_AddRefed<DOMSVGAnimatedNumberList>
SVGComponentTransferFunctionElement::TableValues()
{
return DOMSVGAnimatedNumberList::GetDOMWrapper(
&mNumberListAttributes[TABLEVALUES], this, TABLEVALUES);
}
NS_IMETHODIMP SVGComponentTransferFunctionElement::GetTableValues(nsISupports * *aTableValues)
{
*aTableValues = TableValues().get();
return NS_OK;
}
/* readonly attribute nsIDOMSVGAnimatedNumber slope; */
already_AddRefed<nsIDOMSVGAnimatedNumber>
SVGComponentTransferFunctionElement::Slope()
{
return mNumberAttributes[SLOPE].ToDOMAnimatedNumber(this);
}
NS_IMETHODIMP SVGComponentTransferFunctionElement::GetSlope(nsIDOMSVGAnimatedNumber * *aSlope)
{
*aSlope = Slope().get();
return NS_OK;
}
/* readonly attribute nsIDOMSVGAnimatedNumber intercept; */
already_AddRefed<nsIDOMSVGAnimatedNumber>
SVGComponentTransferFunctionElement::Intercept()
{
return mNumberAttributes[INTERCEPT].ToDOMAnimatedNumber(this);
}
NS_IMETHODIMP SVGComponentTransferFunctionElement::GetIntercept(nsIDOMSVGAnimatedNumber * *aIntercept)
{
*aIntercept = Intercept().get();
return NS_OK;
}
/* readonly attribute nsIDOMSVGAnimatedNumber amplitude; */
already_AddRefed<nsIDOMSVGAnimatedNumber>
SVGComponentTransferFunctionElement::Amplitude()
{
return mNumberAttributes[AMPLITUDE].ToDOMAnimatedNumber(this);
}
NS_IMETHODIMP SVGComponentTransferFunctionElement::GetAmplitude(nsIDOMSVGAnimatedNumber * *aAmplitude)
{
*aAmplitude = Amplitude().get();
return NS_OK;
}
/* readonly attribute nsIDOMSVGAnimatedNumber exponent; */
already_AddRefed<nsIDOMSVGAnimatedNumber>
SVGComponentTransferFunctionElement::Exponent()
{
return mNumberAttributes[EXPONENT].ToDOMAnimatedNumber(this);
}
NS_IMETHODIMP SVGComponentTransferFunctionElement::GetExponent(nsIDOMSVGAnimatedNumber * *aExponent)
{
*aExponent = Exponent().get();
return NS_OK;
}
/* readonly attribute nsIDOMSVGAnimatedNumber offset; */
already_AddRefed<nsIDOMSVGAnimatedNumber>
SVGComponentTransferFunctionElement::Offset()
{
return mNumberAttributes[OFFSET].ToDOMAnimatedNumber(this);
}
NS_IMETHODIMP SVGComponentTransferFunctionElement::GetOffset(nsIDOMSVGAnimatedNumber * *aOffset)
{
*aOffset = Offset().get();
return NS_OK;
}
bool
SVGComponentTransferFunctionElement::GenerateLookupTable(uint8_t *aTable)
@ -1637,7 +1601,7 @@ SVGComponentTransferFunctionElement::GenerateLookupTable(uint8_t *aTable)
uint32_t i;
switch (type) {
case nsIDOMSVGComponentTransferFunctionElement::SVG_FECOMPONENTTRANSFER_TYPE_TABLE:
case SVG_FECOMPONENTTRANSFER_TYPE_TABLE:
{
if (tableValues.Length() < 2)
return false;
@ -1655,7 +1619,7 @@ SVGComponentTransferFunctionElement::GenerateLookupTable(uint8_t *aTable)
break;
}
case nsIDOMSVGComponentTransferFunctionElement::SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE:
case SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE:
{
if (tableValues.Length() < 1)
return false;
@ -1672,7 +1636,7 @@ SVGComponentTransferFunctionElement::GenerateLookupTable(uint8_t *aTable)
break;
}
case nsIDOMSVGComponentTransferFunctionElement::SVG_FECOMPONENTTRANSFER_TYPE_LINEAR:
case SVG_FECOMPONENTTRANSFER_TYPE_LINEAR:
{
for (i = 0; i < 256; i++) {
int32_t val = int32_t(slope * i + 255 * intercept);
@ -1683,7 +1647,7 @@ SVGComponentTransferFunctionElement::GenerateLookupTable(uint8_t *aTable)
break;
}
case nsIDOMSVGComponentTransferFunctionElement::SVG_FECOMPONENTTRANSFER_TYPE_GAMMA:
case SVG_FECOMPONENTTRANSFER_TYPE_GAMMA:
{
for (i = 0; i < 256; i++) {
int32_t val = int32_t(255 * (amplitude * pow(i / 255.0f, exponent) + offset));
@ -1694,7 +1658,7 @@ SVGComponentTransferFunctionElement::GenerateLookupTable(uint8_t *aTable)
break;
}
case nsIDOMSVGComponentTransferFunctionElement::SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY:
case SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY:
default:
break;
}
@ -1725,12 +1689,10 @@ SVGComponentTransferFunctionElement::GetNumberInfo()
ArrayLength(sNumberInfo));
}
NS_IMPL_ISUPPORTS_INHERITED5(SVGFEFuncRElement,
NS_IMPL_ISUPPORTS_INHERITED3(SVGFEFuncRElement,
SVGComponentTransferFunctionElement,
nsIDOMNode, nsIDOMElement,
nsIDOMSVGElement,
nsIDOMSVGComponentTransferFunctionElement,
nsIDOMSVGFEFuncRElement)
nsIDOMSVGElement)
/* virtual */ JSObject*
SVGFEFuncRElement::WrapNode(JSContext* aCx, JSObject* aScope)
@ -1748,12 +1710,10 @@ namespace dom {
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEFuncRElement)
NS_IMPL_ISUPPORTS_INHERITED5(SVGFEFuncGElement,
NS_IMPL_ISUPPORTS_INHERITED3(SVGFEFuncGElement,
SVGComponentTransferFunctionElement,
nsIDOMNode, nsIDOMElement,
nsIDOMSVGElement,
nsIDOMSVGComponentTransferFunctionElement,
nsIDOMSVGFEFuncGElement)
nsIDOMSVGElement)
/* virtual */ JSObject*
SVGFEFuncGElement::WrapNode(JSContext* aCx, JSObject* aScope)
@ -1771,12 +1731,10 @@ namespace dom {
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEFuncGElement)
NS_IMPL_ISUPPORTS_INHERITED5(SVGFEFuncBElement,
NS_IMPL_ISUPPORTS_INHERITED3(SVGFEFuncBElement,
SVGComponentTransferFunctionElement,
nsIDOMNode, nsIDOMElement,
nsIDOMSVGElement,
nsIDOMSVGComponentTransferFunctionElement,
nsIDOMSVGFEFuncBElement)
nsIDOMSVGElement)
/* virtual */ JSObject*
SVGFEFuncBElement::WrapNode(JSContext* aCx, JSObject* aScope)
@ -1794,12 +1752,10 @@ namespace dom {
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEFuncBElement)
NS_IMPL_ISUPPORTS_INHERITED5(SVGFEFuncAElement,
NS_IMPL_ISUPPORTS_INHERITED3(SVGFEFuncAElement,
SVGComponentTransferFunctionElement,
nsIDOMNode, nsIDOMElement,
nsIDOMSVGElement,
nsIDOMSVGComponentTransferFunctionElement,
nsIDOMSVGFEFuncAElement)
nsIDOMSVGElement)
/* virtual */ JSObject*
SVGFEFuncAElement::WrapNode(JSContext* aCx, JSObject* aScope)

View File

@ -37,27 +37,6 @@ interface nsIDOMSVGFEColorMatrixElement : nsIDOMSVGFilterPrimitiveStandardAttrib
readonly attribute nsISupports values;
};
[scriptable, uuid(3fa8c369-df5b-4bfb-9651-c999bc22fbc7)]
interface nsIDOMSVGComponentTransferFunctionElement : nsIDOMSVGElement
{
// Component Transfer Types
const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN = 0;
const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY = 1;
const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_TABLE = 2;
const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE = 3;
const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_LINEAR = 4;
const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_GAMMA = 5;
readonly attribute nsIDOMSVGAnimatedEnumeration type;
// SVGAnimatedNumberList
readonly attribute nsISupports tableValues;
readonly attribute nsIDOMSVGAnimatedNumber slope;
readonly attribute nsIDOMSVGAnimatedNumber intercept;
readonly attribute nsIDOMSVGAnimatedNumber amplitude;
readonly attribute nsIDOMSVGAnimatedNumber exponent;
readonly attribute nsIDOMSVGAnimatedNumber offset;
};
[scriptable, uuid(f264fd1f-b272-4796-99b5-68c90cbd030c)]
interface nsIDOMSVGFECompositeElement : nsIDOMSVGFilterPrimitiveStandardAttributes
{
@ -82,26 +61,6 @@ interface nsIDOMSVGFECompositeElement : nsIDOMSVGFilterPrimitiveStandardAttribut
};
[scriptable, uuid(7ff6cba9-65e0-48d2-9d81-4ab26782a945)]
interface nsIDOMSVGFEFuncRElement : nsIDOMSVGComponentTransferFunctionElement
{
};
[scriptable, uuid(b6a7ad39-724f-42ab-8d3f-a05d1cf7ab0c)]
interface nsIDOMSVGFEFuncGElement : nsIDOMSVGComponentTransferFunctionElement
{
};
[scriptable, uuid(c414b7dd-7ff2-4158-988a-20943d22db52)]
interface nsIDOMSVGFEFuncBElement : nsIDOMSVGComponentTransferFunctionElement
{
};
[scriptable, uuid(f4f5fe63-9570-48f7-ba7e-a5300fa71aed)]
interface nsIDOMSVGFEFuncAElement : nsIDOMSVGComponentTransferFunctionElement
{
};
[scriptable, uuid(08f2d7e5-b79f-405c-8140-7faa72c53ead)]
interface nsIDOMSVGFEGaussianBlurElement : nsIDOMSVGFilterPrimitiveStandardAttributes
{

View File

@ -96,7 +96,6 @@ Histogram* Histogram::FactoryGet(const std::string& name,
// Extra variable is not needed... but this keeps this section basically
// identical to other derived classes in this file (and compiler will
// optimize away the extra variable.
// To avoid racy destruction at shutdown, the following will be leaked.
Histogram* tentative_histogram =
new Histogram(name, minimum, maximum, bucket_count);
tentative_histogram->InitializeBucketRange();
@ -853,7 +852,6 @@ Histogram* LinearHistogram::FactoryGet(const std::string& name,
maximum = kSampleType_MAX - 1;
if (!StatisticsRecorder::FindHistogram(name, &histogram)) {
// To avoid racy destruction at shutdown, the following will be leaked.
LinearHistogram* tentative_histogram =
new LinearHistogram(name, minimum, maximum, bucket_count);
tentative_histogram->InitializeBucketRange();
@ -949,7 +947,6 @@ Histogram* BooleanHistogram::FactoryGet(const std::string& name, Flags flags) {
Histogram* histogram(NULL);
if (!StatisticsRecorder::FindHistogram(name, &histogram)) {
// To avoid racy destruction at shutdown, the following will be leaked.
BooleanHistogram* tentative_histogram = new BooleanHistogram(name);
tentative_histogram->InitializeBucketRange();
tentative_histogram->SetFlags(flags);
@ -991,7 +988,6 @@ FlagHistogram::FactoryGet(const std::string &name, Flags flags)
Histogram *h(nullptr);
if (!StatisticsRecorder::FindHistogram(name, &h)) {
// To avoid racy destruction at shutdown, the following will be leaked.
FlagHistogram *fh = new FlagHistogram(name);
fh->InitializeBucketRange();
fh->SetFlags(flags);
@ -1075,7 +1071,6 @@ Histogram* CustomHistogram::FactoryGet(const std::string& name,
DCHECK_LT(ranges.back(), kSampleType_MAX);
if (!StatisticsRecorder::FindHistogram(name, &histogram)) {
// To avoid racy destruction at shutdown, the following will be leaked.
CustomHistogram* tentative_histogram = new CustomHistogram(name, ranges);
tentative_histogram->InitializedCustomBucketRange(ranges);
tentative_histogram->SetFlags(flags);
@ -1152,6 +1147,13 @@ StatisticsRecorder::~StatisticsRecorder() {
base::AutoLock auto_lock(*lock_);
histograms = histograms_;
histograms_ = NULL;
for (HistogramMap::iterator it = histograms->begin();
histograms->end() != it;
++it) {
// No other clients permanently hold Histogram references, so we
// have the only one and it is safe to delete it.
delete it->second;
}
}
delete histograms;
// We don't delete lock_ on purpose to avoid having to properly protect

View File

@ -46,7 +46,6 @@ VPATH += \
$(srcdir)/ds \
$(srcdir)/frontend \
$(srcdir)/gc \
$(srcdir)/ion \
$(srcdir)/vm \
$(NULL)
@ -145,9 +144,6 @@ CPPSRCS = \
Unicode.cpp \
Xdr.cpp \
Module.cpp \
AsmJS.cpp \
AsmJSLink.cpp \
AsmJSSignalHandlers.cpp \
$(NULL)
# Changes to internal header files, used externally, massively slow down
@ -295,6 +291,9 @@ CPPSRCS += MIR.cpp \
ParallelArrayAnalysis.cpp \
UnreachableCodeElimination.cpp \
EffectiveAddressAnalysis.cpp \
AsmJS.cpp \
AsmJSLink.cpp \
AsmJSSignalHandlers.cpp \
$(NULL)
endif #ENABLE_ION
ifeq (86, $(findstring 86,$(TARGET_CPU)))

View File

@ -57,7 +57,6 @@ def InvokeClWithDependencyGeneration(cmdline):
f = open(depstarget, "w")
for dep in sorted(deps):
print >>f, "%s: %s" % (target, dep)
print >>f, "%s:" % dep
if __name__ == "__main__":
InvokeClWithDependencyGeneration(sys.argv[1:])

View File

@ -1,37 +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/.
import pymake.data
import pymake.parser
import pymake.parserdata
import sys
'''
Modifies the output of Sun Studio's -xM to look more like the output
of gcc's -MD -MP, adding phony targets for dependencies.
'''
def add_phony_targets(path):
print path
deps = set()
targets = set()
for stmt in pymake.parser.parsefile(path):
if isinstance(stmt, pymake.parserdata.Rule):
assert isinstance(stmt.depexp, pymake.data.StringExpansion)
assert isinstance(stmt.targetexp, pymake.data.StringExpansion)
for d in stmt.depexp.s.split():
deps.add(d)
for t in stmt.targetexp.s.split():
targets.add(t)
phony_targets = deps - targets
if not phony_targets:
return
with open(path, 'a') as f:
f.writelines('%s:\n' % d for d in phony_targets)
if __name__ == '__main__':
for f in sys.argv[1:]:
add_phony_targets(f)

View File

@ -0,0 +1,139 @@
#!/usr/bin/env perl
# 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/.
# mddepend.pl - Reads in dependencies generated my -MD flag. Prints list
# of objects that need to be rebuilt. These can then be added to the
# PHONY target. Using this script copes with the problem of header
# files that have been removed from the build.
#
# Usage:
# mddepend.pl <output_file> <dependency_files...>
#
# Send comments, improvements, bugs to Steve Lamm (slamm@netscape.com).
use strict;
use constant DEBUG => 0;
my $outfile = shift @ARGV;
my $silent = $ENV{MAKEFLAGS} =~ /^\w*s|\s-s/;
my $line = '';
my %alldeps;
# Parse dependency files
while (<>) {
s/\r?\n$//; # Handle both unix and DOS line endings
$line .= $_;
if ($line =~ /\\$/) {
chop $line;
next;
}
$line =~ s|\\|/|g;
my ($obj,$rest) = split /\s*:\s+/, $line, 2;
$line = '';
next if !$obj || !$rest;
my @deps = split /\s+/, $rest;
push @{$alldeps{$obj}}, @deps;
if (DEBUG >= 2) {
foreach my $dep (@deps) { print STDERR "add $obj $dep\n"; }
}
}
# Test dependencies
my %modtimes; # cache
my @objs; # force rebuild on these
OBJ_LOOP: foreach my $obj (keys %alldeps) {
my $mtime = (stat $obj)[9] or next;
my %not_in_cache;
my $deps = $alldeps{$obj};
foreach my $dep_file (@{$deps}) {
my $dep_mtime = $modtimes{$dep_file};
if (not defined $dep_mtime) {
print STDERR "Skipping $dep_file for $obj, will stat() later\n" if DEBUG >= 2;
$not_in_cache{$dep_file} = 1;
next;
}
print STDERR "Found $dep_file in cache\n" if DEBUG >= 2;
if ($dep_mtime > $mtime) {
print STDERR "$dep_file($dep_mtime) newer than $obj($mtime)\n" if DEBUG;
}
elsif ($dep_mtime == -1) {
print STDERR "Couldn't stat $dep_file for $obj\n" if DEBUG;
}
else {
print STDERR "$dep_file($dep_mtime) older than $obj($mtime)\n" if DEBUG >= 2;
next;
}
push @objs, $obj; # dependency is missing or newer
next OBJ_LOOP; # skip checking the rest of the dependencies
}
foreach my $dep_file (keys %not_in_cache) {
print STDERR "STAT $dep_file for $obj\n" if DEBUG >= 2;
my $dep_mtime = $modtimes{$dep_file} = (stat $dep_file)[9] || -1;
if ($dep_mtime > $mtime) {
print STDERR "$dep_file($dep_mtime) newer than $obj($mtime)\n" if DEBUG;
}
elsif ($dep_mtime == -1) {
print STDERR "Couldn't stat $dep_file for $obj\n" if DEBUG;
}
else {
print STDERR "$dep_file($dep_mtime) older than $obj($mtime)\n" if DEBUG >= 2;
next;
}
push @objs, $obj; # dependency is missing or newer
next OBJ_LOOP; # skip checking the rest of the dependencies
}
# If we get here it means nothing needs to be done for $obj
}
# Output objects to rebuild (if needed).
if ($outfile eq '-') {
if (@objs) {
print "@objs: FORCE\n";
}
} elsif (@objs) {
my $old_output;
my $new_output = "@objs: FORCE\n";
# Read in the current dependencies file.
open(OLD, "<$outfile")
and $old_output = <OLD>;
close(OLD);
# Only write out the dependencies if they are different.
if ($new_output ne $old_output) {
open(OUT, ">$outfile") and print OUT "$new_output";
print "Updating dependencies file, $outfile\n" unless $silent;
if (DEBUG) {
print "new: $new_output\n";
print "was: $old_output\n" if $old_output ne '';
}
}
} elsif (-s $outfile) {
# Remove the old dependencies because all objects are up to date.
print "Removing old dependencies file, $outfile\n" unless $silent;
if (DEBUG) {
my $old_output;
open(OLD, "<$outfile")
and $old_output = <OLD>;
close(OLD);
print "was: $old_output\n";
}
unlink $outfile;
}

View File

@ -905,6 +905,16 @@ js::testingFunc_inParallelSection(JSContext *cx, unsigned argc, jsval *vp)
return true;
}
#ifndef JS_ION
JSBool
js::IsAsmJSCompilationAvailable(JSContext *cx, unsigned argc, Value *vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
args.rval().set(BooleanValue(false));
return true;
}
#endif
static JSFunctionSpecWithHelp TestingFunctions[] = {
JS_FN_HELP("gc", ::GC, 0, 0,
"gc([obj] | 'compartment')",

View File

@ -329,9 +329,6 @@ def main():
with open(options.depend, 'w') as depfile:
depfile.write("%s : %s\n" % (options.target, ' '.join(dep for dep in deps if os.path.isfile(dep) and dep != options.target)))
for dep in deps:
if os.path.isfile(dep) and dep != options.target:
depfile.write("%s :\n" % dep)
if __name__ == '__main__':
main()

View File

@ -44,7 +44,4 @@ if __name__ == '__main__':
if options.depend:
ensureParentDir(options.depend)
with open(options.depend, 'w') as depfile:
deps = ExpandLibsDeps(args)
depfile.write("%s : %s\n" % (options.output, ' '.join(deps)))
for dep in deps:
depfile.write("%s :\n" % dep)
depfile.write("%s : %s\n" % (options.output, ' '.join(ExpandLibsDeps(args))))

View File

@ -986,19 +986,17 @@ define MAKE_DEPS_AUTO_CC
if test -d $(@D); then \
echo "Building deps for $< using Sun Studio cc"; \
$(CC) $(COMPILE_CFLAGS) -xM $< >$(_MDDEPFILE) ; \
$(PYTHON) $(topsrcdir)/build/unix/add_phony_targets.py $(_MDDEPFILE) ; \
fi
endef
define MAKE_DEPS_AUTO_CXX
if test -d $(@D); then \
echo "Building deps for $< using Sun Studio CC"; \
$(CXX) $(COMPILE_CXXFLAGS) -xM $< >$(_MDDEPFILE) ; \
$(PYTHON) $(topsrcdir)/build/unix/add_phony_targets.py $(_MDDEPFILE) ; \
fi
endef
endif # Sun Studio on Solaris
$(OBJS) $(HOST_OBJS) $(PROGOBJS) $(HOST_PROGOBJS): $(GLOBAL_DEPS)
$(OBJS) $(HOST_OBJS): $(GLOBAL_DEPS)
# Rules for building native targets must come first because of the host_ prefix
$(HOST_COBJS): host_%.$(OBJ_SUFFIX): %.c
@ -1615,7 +1613,14 @@ ifneq (,$(filter-out all chrome default export realchrome tools clean clobber cl
MDDEPEND_FILES := $(strip $(wildcard $(foreach file,$(OBJS) $(PROGOBJS) $(HOST_OBJS) $(HOST_PROGOBJS) $(TARGETS) $(XPIDLSRCS:.idl=.h) $(XPIDLSRCS:.idl=.xpt),$(MDDEPDIR)/$(notdir $(file)).pp) $(addprefix $(MDDEPDIR)/,$(EXTRA_MDDEPEND_FILES))))
ifneq (,$(MDDEPEND_FILES))
include $(MDDEPEND_FILES)
# The script mddepend.pl checks the dependencies and writes to stdout
# one rule to force out-of-date objects. For example,
# foo.o boo.o: FORCE
# The script has an advantage over including the *.pp files directly
# because it handles the case when header files are removed from the build.
# 'make' would complain that there is no way to build missing headers.
ALL_PP_RESULTS = $(shell $(PERL) $(BUILD_TOOLS)/mddepend.pl - $(MDDEPEND_FILES))
$(eval $(ALL_PP_RESULTS))
endif
endif

View File

@ -3976,7 +3976,7 @@ dnl ========================================================
MOZ_ARG_HEADER(Build dependencies)
if test "$GNU_CC" -a "$GNU_CXX"; then
_DEPEND_CFLAGS='-MD -MP -MF $(MDDEPDIR)/$(@F).pp'
_DEPEND_CFLAGS='$(filter-out %/.pp,-MD -MF $(MDDEPDIR)/$(@F).pp)'
dnl Sun Studio on Solaris use -xM instead of -MD, see config/rules.mk
elif test "$SOLARIS_SUNPRO_CC"; then
_DEPEND_CFLAGS=

View File

@ -407,12 +407,14 @@ frontend::CompileFunctionBody(JSContext *cx, HandleFunction fun, CompileOptions
pn = fn->pn_body;
}
#ifdef JS_ION
/*
* Do asm.js compilation once the parse tree has been fully assembled but
* before emitting since we need to know whether to emit JSOP_LINKASMJS.
*/
if (fn->pn_funbox->useAsm && !CompileAsmJS(cx, parser.tokenStream, fn, script))
return false;
#endif
if (!SetSourceMap(cx, parser.tokenStream, ss, script))
return false;

View File

@ -4392,12 +4392,14 @@ EmitFunc(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn)
script->bindings = funbox->bindings;
#ifdef JS_ION
// Do asm.js compilation at the beginning of emitting to avoid
// compiling twice when JS_BufferIsCompilableUnit and to know whether
// to emit JSOP_LINKASMJS. Don't fold constants as this will
// misrepresent the source JS as written to the type checker.
if (funbox->useAsm && !CompileAsmJS(cx, *bce->tokenStream(), pn, script))
return false;
#endif
BytecodeEmitter bce2(bce, bce->parser, funbox, script, bce->evalCaller,
bce->hasGlobalScope, pn->pn_pos.begin.lineno, bce->selfHostingMode);

View File

@ -16,14 +16,14 @@ using namespace js;
using namespace js::frontend;
using namespace mozilla;
#ifdef JS_ASMJS
#include "ion/CodeGenerator.h"
#include "ion/MIR.h"
#include "ion/MIRGraph.h"
using namespace js::ion;
#ifdef JS_ASMJS
/*****************************************************************************/
// ParseNode utilities

View File

@ -17,6 +17,8 @@ using namespace js;
using namespace js::ion;
using namespace mozilla;
#ifdef JS_ASMJS
static bool
LinkFail(JSContext *cx, const char *str)
{
@ -403,3 +405,5 @@ js::LinkAsmJS(JSContext *cx, StackFrame *fp, MutableHandleValue rval)
rval.set(ObjectValue(*obj));
return true;
}
#endif // defined(JS_ASMJS)

View File

@ -1105,6 +1105,22 @@ XPCJSRuntime::ActivityCallback(void *arg, JSBool active)
}
}
// static
//
// JS-CTypes creates and caches a JSContext that it uses when executing JS
// callbacks. When we're notified that ctypes is about to call into some JS,
// push the cx to maintain the integrity of the context stack.
void
XPCJSRuntime::CTypesActivityCallback(JSContext *cx, js::CTypesActivityType type)
{
if (type == js::CTYPES_CALLBACK_BEGIN) {
if (!Get()->GetJSContextStack()->Push(cx))
MOZ_CRASH();
} else if (type == js::CTYPES_CALLBACK_END) {
Get()->GetJSContextStack()->Pop();
}
}
size_t
XPCJSRuntime::SizeOfIncludingThis(nsMallocSizeOfFun mallocSizeOf)
{
@ -2638,6 +2654,7 @@ XPCJSRuntime::XPCJSRuntime(nsXPConnect* aXPConnect)
#endif
JS_SetAccumulateTelemetryCallback(mJSRuntime, AccumulateTelemetryCallback);
js::SetActivityCallback(mJSRuntime, ActivityCallback, this);
js::SetCTypesActivityCallback(mJSRuntime, CTypesActivityCallback);
// The JS engine needs to keep the source code around in order to implement
// Function.prototype.toSource(). It'd be nice to not have to do this for

View File

@ -897,6 +897,8 @@ public:
void RemoveGCCallback(JSGCCallback cb);
static void ActivityCallback(void *arg, JSBool active);
static void CTypesActivityCallback(JSContext *cx,
js::CTypesActivityType type);
bool XBLScopesEnabled() {
return gXBLScopesEnabled;

View File

@ -11,6 +11,7 @@
#include "mozilla/mozalloc_abort.h"
#include "mozilla/mozalloc_oom.h"
#include "mozilla/Assertions.h"
static mozalloc_oom_abort_handler gAbortHandler;
@ -27,7 +28,7 @@ void
mozalloc_handle_oom(size_t size)
{
char oomMsg[] = OOM_MSG_LEADER OOM_MSG_DIGITS OOM_MSG_TRAILER;
int i;
size_t i;
// NB: this is handle_oom() stage 1, which simply aborts on OOM.
// we might proceed to a stage 2 in which an attempt is made to
@ -36,6 +37,9 @@ mozalloc_handle_oom(size_t size)
if (gAbortHandler)
gAbortHandler(size);
MOZ_STATIC_ASSERT(OOM_MSG_FIRST_DIGIT_OFFSET > 0,
"Loop below will never terminate (i can't go below 0)");
// Insert size into the diagnostic message using only primitive operations
for (i = OOM_MSG_LAST_DIGIT_OFFSET;
size && i >= OOM_MSG_FIRST_DIGIT_OFFSET; i--) {

View File

@ -31,7 +31,7 @@ endif
endif
install::
$(ANDROID_PLATFORM_TOOLS)/adb install -r $(DIST)/$(PKG_PATH)$(PKG_BASENAME).apk
$(ANDROID_PLATFORM_TOOLS)/adb install -r -d $(DIST)/$(PKG_PATH)$(PKG_BASENAME).apk
else
@echo "Mobile can't be installed directly."
@exit 1

View File

@ -18,6 +18,4 @@ def writeMakeDependOutput(filename):
f.write('\n\n')
for filename in targets[1:]:
f.write('%s: %s\n' % (makeQuote(filename), makeQuote(targets[0])))
for filename in dependencies:
f.write('%s:\n' % filename)

View File

@ -259,6 +259,7 @@
"dom/imptests/webapps/DOMCore/tests/approved/test_Range-extractContents.html":"",
"dom/imptests/webapps/DOMCore/tests/approved/test_Range-insertNode.html":"",
"dom/imptests/webapps/DOMCore/tests/approved/test_Range-surroundContents.html":"",
"dom/imptests/webapps/DOMCore/tests/approved/test_Range-mutations.html":" Test timed out.",
"dom/indexedDB/": "",
"dom/mobilemessage/tests/test_sms_basics.html": "",
"dom/media/tests/mochitest/test_getUserMedia_exceptions.html":"",

View File

@ -2628,6 +2628,15 @@ function run_single_closure_tests(library, abi, suffix)
var fn_v_t = ctypes.FunctionType(ctypes.default_abi, ctypes.void_t, []).ptr;
fn_v_t(function() {})(); // Don't crash
// Code evaluated in a sandbox uses (and pushes) a separate JSContext.
// Make sure that we don't run into an assertion caused by a cx stack
// mismatch with the cx stashed in the closure.
try {
var sb = Components.utils.Sandbox("http://www.example.com");
sb.fn = fn_v_t(function() {sb.foo = {};});
Components.utils.evalInSandbox("fn();", sb);
} catch (e) {} // Components not available in workers.
// Make sure that a void callback can't return an error sentinel.
var sentinelThrew = false;
try {

View File

@ -538,5 +538,3 @@ if __name__ == '__main__':
deps = [dep.replace('\\', '/') for dep in idl.deps]
print >>depfd, "%s: %s" % (options.outfile, " ".join(deps))
for dep in deps:
print >>depfd, "%s:" % dep