mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 13:57:32 +00:00
Merge m-c to fx-team, a=merge
--HG-- extra : commitid : D0yQXR2v0Qz
This commit is contained in:
commit
5d41c4ca14
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="59c8605876736b22acaaed25be00008e452149cb"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7847a3c1b28e039631509978518b36fd3c5f9585"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="59c8605876736b22acaaed25be00008e452149cb"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7847a3c1b28e039631509978518b36fd3c5f9585"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
|
||||
<default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
|
||||
<!-- Gecko and Gaia -->
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="59c8605876736b22acaaed25be00008e452149cb"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="7847a3c1b28e039631509978518b36fd3c5f9585"/>
|
||||
<!-- Gonk-specific things and forks -->
|
||||
<project name="platform_bionic" path="bionic" remote="b2g" revision="e2b3733ba3fa5e3f404e983d2e4142b1f6b1b846"/>
|
||||
<project name="platform_build" path="build" remote="b2g" revision="1b0db93fb6b870b03467aff50d6419771ba0d88c">
|
||||
|
@ -17,7 +17,7 @@
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="59c8605876736b22acaaed25be00008e452149cb"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7847a3c1b28e039631509978518b36fd3c5f9585"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="5de6856fad82857028f9f059f50680a9bea5b75c"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="59c8605876736b22acaaed25be00008e452149cb"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7847a3c1b28e039631509978518b36fd3c5f9585"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="59c8605876736b22acaaed25be00008e452149cb"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7847a3c1b28e039631509978518b36fd3c5f9585"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
|
||||
<default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
|
||||
<!-- Gecko and Gaia -->
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="59c8605876736b22acaaed25be00008e452149cb"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="7847a3c1b28e039631509978518b36fd3c5f9585"/>
|
||||
<!-- Gonk-specific things and forks -->
|
||||
<project name="platform_bionic" path="bionic" remote="b2g" revision="e2b3733ba3fa5e3f404e983d2e4142b1f6b1b846"/>
|
||||
<project name="platform_build" path="build" remote="b2g" revision="1b0db93fb6b870b03467aff50d6419771ba0d88c">
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="59c8605876736b22acaaed25be00008e452149cb"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7847a3c1b28e039631509978518b36fd3c5f9585"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
|
||||
|
@ -1,9 +1,9 @@
|
||||
{
|
||||
"git": {
|
||||
"git_revision": "59c8605876736b22acaaed25be00008e452149cb",
|
||||
"git_revision": "7847a3c1b28e039631509978518b36fd3c5f9585",
|
||||
"remote": "https://git.mozilla.org/releases/gaia.git",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "09d11f2ffa29c5f32712084fb8ac6023056f6c24",
|
||||
"revision": "0e366e8ecec7ab9426eb8781206119b4f564db84",
|
||||
"repo_path": "integration/gaia-central"
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="59c8605876736b22acaaed25be00008e452149cb"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7847a3c1b28e039631509978518b36fd3c5f9585"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
|
||||
|
@ -18,7 +18,7 @@
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="59c8605876736b22acaaed25be00008e452149cb"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7847a3c1b28e039631509978518b36fd3c5f9585"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="5de6856fad82857028f9f059f50680a9bea5b75c"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="59c8605876736b22acaaed25be00008e452149cb"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="7847a3c1b28e039631509978518b36fd3c5f9585"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
|
||||
|
@ -578,9 +578,10 @@ nsContentList::GetSupportedNames(unsigned aFlags, nsTArray<nsString>& aNames)
|
||||
}
|
||||
}
|
||||
|
||||
aNames.SetCapacity(atoms.Length());
|
||||
for (uint32_t i = 0; i < atoms.Length(); ++i) {
|
||||
aNames.AppendElement(nsDependentAtomString(atoms[i]));
|
||||
uint32_t atomsLen = atoms.Length();
|
||||
nsString* names = aNames.AppendElements(atomsLen);
|
||||
for (uint32_t i = 0; i < atomsLen; ++i) {
|
||||
atoms[i]->ToString(names[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -759,12 +759,14 @@ nsDOMMutationObserver::GetObservingInfo(
|
||||
info.mAttributeFilter.Construct();
|
||||
mozilla::dom::Sequence<nsString>& filtersAsStrings =
|
||||
info.mAttributeFilter.Value();
|
||||
nsString* strings = filtersAsStrings.AppendElements(filters.Count(),
|
||||
mozilla::fallible);
|
||||
if (!strings) {
|
||||
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
|
||||
return;
|
||||
}
|
||||
for (int32_t j = 0; j < filters.Count(); ++j) {
|
||||
if (!filtersAsStrings.AppendElement(nsDependentAtomString(filters[j]),
|
||||
mozilla::fallible)) {
|
||||
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
|
||||
return;
|
||||
}
|
||||
filters[j]->ToString(strings[j]);
|
||||
}
|
||||
}
|
||||
info.mObservedNode = mr->Target();
|
||||
|
@ -2311,6 +2311,11 @@ nsDocument::ResetStylesheetsToURI(nsIURI* aURI)
|
||||
RemoveStyleSheetsFromStyleSets(mAdditionalSheets[eUserSheet], SheetType::User);
|
||||
RemoveStyleSheetsFromStyleSets(mAdditionalSheets[eAuthorSheet], SheetType::Doc);
|
||||
|
||||
nsStyleSheetService *sheetService = nsStyleSheetService::GetInstance();
|
||||
if (sheetService) {
|
||||
RemoveStyleSheetsFromStyleSets(*sheetService->AuthorStyleSheets(), SheetType::Doc);
|
||||
}
|
||||
|
||||
// Release all the sheets
|
||||
mStyleSheets.Clear();
|
||||
mOnDemandBuiltInUASheets.Clear();
|
||||
|
@ -35,7 +35,7 @@ interface nsIDocumentEncoderNodeFixup : nsISupports
|
||||
nsIDOMNode fixupNode(in nsIDOMNode aNode, out boolean aSerializeCloneKids);
|
||||
};
|
||||
|
||||
[scriptable, uuid(e5ec69d7-eaa7-4de7-986b-455e17c7f71a)]
|
||||
[scriptable, uuid(21f112df-d96f-47da-bfcb-5331273003d1)]
|
||||
interface nsIDocumentEncoder : nsISupports
|
||||
{
|
||||
// Output methods flag bits. There are a frightening number of these,
|
||||
@ -240,6 +240,13 @@ interface nsIDocumentEncoder : nsISupports
|
||||
*/
|
||||
const unsigned long OutputRubyAnnotation = (1 << 26);
|
||||
|
||||
/**
|
||||
* Disallow breaking of long character strings. This is important
|
||||
* for serializing e-mail which contains CJK strings. These must
|
||||
* not be broken just as "normal" longs strings aren't broken.
|
||||
*/
|
||||
const unsigned long OutputDisallowLineBreaking = (1 << 27);
|
||||
|
||||
/**
|
||||
* Initialize with a pointer to the document and the mime type.
|
||||
* @param aDocument Document to encode.
|
||||
|
@ -144,7 +144,7 @@ nsPlainTextSerializer::Init(uint32_t aFlags, uint32_t aWrapColumn,
|
||||
mWrapColumn = aWrapColumn;
|
||||
|
||||
// Only create a linebreaker if we will handle wrapping.
|
||||
if (MayWrap()) {
|
||||
if (MayWrap() && MayBreakLines()) {
|
||||
mLineBreaker = nsContentUtils::LineBreaker();
|
||||
}
|
||||
|
||||
|
@ -101,6 +101,10 @@ private:
|
||||
((mFlags & nsIDocumentEncoder::OutputFormatted) ||
|
||||
(mFlags & nsIDocumentEncoder::OutputWrap));
|
||||
}
|
||||
inline bool MayBreakLines()
|
||||
{
|
||||
return !(mFlags & nsIDocumentEncoder::OutputDisallowLineBreaking);
|
||||
}
|
||||
|
||||
inline bool DoOutput()
|
||||
{
|
||||
|
@ -323,9 +323,11 @@ nsSyncLoadService::LoadDocument(nsIURI *aURI,
|
||||
}
|
||||
|
||||
bool isChrome = false, isResource = false;
|
||||
// if the load needs to enforce CORS, then force the load to be async
|
||||
bool isSync =
|
||||
(NS_SUCCEEDED(aURI->SchemeIs("chrome", &isChrome)) && isChrome) ||
|
||||
(NS_SUCCEEDED(aURI->SchemeIs("resource", &isResource)) && isResource);
|
||||
!(aSecurityFlags & nsILoadInfo::SEC_REQUIRE_CORS_DATA_INHERITS) &&
|
||||
((NS_SUCCEEDED(aURI->SchemeIs("chrome", &isChrome)) && isChrome) ||
|
||||
(NS_SUCCEEDED(aURI->SchemeIs("resource", &isResource)) && isResource));
|
||||
RefPtr<nsSyncLoader> loader = new nsSyncLoader();
|
||||
return loader->LoadDocument(channel, isSync, aForceToXML,
|
||||
aReferrerPolicy, aResult);
|
||||
|
@ -112,6 +112,8 @@ nsXMLContentSerializer::Init(uint32_t aFlags, uint32_t aWrapColumn,
|
||||
|
||||
mDoWrap = (mFlags & nsIDocumentEncoder::OutputWrap && !mDoRaw);
|
||||
|
||||
mAllowLineBreaking = !(mFlags & nsIDocumentEncoder::OutputDisallowLineBreaking);
|
||||
|
||||
if (!aWrapColumn) {
|
||||
mMaxColumn = 72;
|
||||
}
|
||||
@ -1539,23 +1541,25 @@ nsXMLContentSerializer::AppendWrapped_NonWhitespaceSequence(
|
||||
// we must wrap
|
||||
onceAgainBecauseWeAddedBreakInFront = false;
|
||||
bool foundWrapPosition = false;
|
||||
int32_t wrapPosition;
|
||||
int32_t wrapPosition = 0;
|
||||
|
||||
nsILineBreaker *lineBreaker = nsContentUtils::LineBreaker();
|
||||
if (mAllowLineBreaking) {
|
||||
nsILineBreaker *lineBreaker = nsContentUtils::LineBreaker();
|
||||
|
||||
wrapPosition = lineBreaker->Prev(aSequenceStart,
|
||||
(aEnd - aSequenceStart),
|
||||
(aPos - aSequenceStart) + 1);
|
||||
if (wrapPosition != NS_LINEBREAKER_NEED_MORE_TEXT) {
|
||||
foundWrapPosition = true;
|
||||
}
|
||||
else {
|
||||
wrapPosition = lineBreaker->Next(aSequenceStart,
|
||||
wrapPosition = lineBreaker->Prev(aSequenceStart,
|
||||
(aEnd - aSequenceStart),
|
||||
(aPos - aSequenceStart));
|
||||
(aPos - aSequenceStart) + 1);
|
||||
if (wrapPosition != NS_LINEBREAKER_NEED_MORE_TEXT) {
|
||||
foundWrapPosition = true;
|
||||
}
|
||||
else {
|
||||
wrapPosition = lineBreaker->Next(aSequenceStart,
|
||||
(aEnd - aSequenceStart),
|
||||
(aPos - aSequenceStart));
|
||||
if (wrapPosition != NS_LINEBREAKER_NEED_MORE_TEXT) {
|
||||
foundWrapPosition = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (foundWrapPosition) {
|
||||
|
@ -355,6 +355,9 @@ class nsXMLContentSerializer : public nsIContentSerializer {
|
||||
// true = wrapping should be done (OutputWrap flag)
|
||||
bool mDoWrap;
|
||||
|
||||
// true = we can break lines (OutputDisallowLineBreaking flag)
|
||||
bool mAllowLineBreaking;
|
||||
|
||||
// number of maximum column in a line, in the wrap mode
|
||||
uint32_t mMaxColumn;
|
||||
|
||||
|
@ -94,6 +94,42 @@ TestCJKWithFlowedDelSp()
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Test for CJK with DisallowLineBreaking
|
||||
nsresult
|
||||
TestCJKWithDisallowLineBreaking()
|
||||
{
|
||||
nsString test;
|
||||
nsString result;
|
||||
|
||||
test.AssignLiteral("<html><body>");
|
||||
for (uint32_t i = 0; i < 400; i++) {
|
||||
// Insert Kanji (U+5341)
|
||||
test.Append(0x5341);
|
||||
}
|
||||
test.AppendLiteral("</body></html>");
|
||||
|
||||
ConvertBufToPlainText(test, nsIDocumentEncoder::OutputFormatted |
|
||||
nsIDocumentEncoder::OutputCRLineBreak |
|
||||
nsIDocumentEncoder::OutputLFLineBreak |
|
||||
nsIDocumentEncoder::OutputFormatFlowed |
|
||||
nsIDocumentEncoder::OutputDisallowLineBreaking);
|
||||
|
||||
// create result case
|
||||
for (uint32_t i = 0; i < 400; i++) {
|
||||
result.Append(0x5341);
|
||||
}
|
||||
result.AppendLiteral("\r\n");
|
||||
|
||||
if (!test.Equals(result)) {
|
||||
fail("Wrong HTML to CJK text serialization with OutputDisallowLineBreaking");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
passed("HTML to CJK text serialization with OutputDisallowLineBreaking");
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
TestPrettyPrintedHtml()
|
||||
{
|
||||
@ -228,6 +264,9 @@ TestPlainTextSerializer()
|
||||
rv = TestPreWrapElementForThunderbird();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = TestCJKWithDisallowLineBreaking();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Add new tests here...
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -13099,12 +13099,16 @@ class CGBindingRoot(CGThing):
|
||||
d.concrete and d.proxy for d in descriptors)
|
||||
|
||||
def descriptorHasChromeOnly(desc):
|
||||
ctor = desc.interface.ctor()
|
||||
|
||||
return (any(isChromeOnly(a) for a in desc.interface.members) or
|
||||
desc.interface.getExtendedAttribute("ChromeOnly") is not None or
|
||||
# JS-implemented interfaces with an interface object get a
|
||||
# chromeonly _create method.
|
||||
(desc.interface.isJSImplemented() and
|
||||
desc.interface.hasInterfaceObject()))
|
||||
# chromeonly _create method. And interfaces with an
|
||||
# interface object might have a ChromeOnly constructor.
|
||||
(desc.interface.hasInterfaceObject() and
|
||||
(desc.interface.isJSImplemented() or
|
||||
(ctor and isChromeOnly(ctor)))))
|
||||
|
||||
bindingHeaders["nsContentUtils.h"] = any(
|
||||
descriptorHasChromeOnly(d) for d in descriptors)
|
||||
|
@ -826,7 +826,8 @@ BluetoothDaemonGattModule::ServerAddCharacteristicCmd(
|
||||
4)); // Permissions
|
||||
|
||||
nsresult rv = PackPDU(
|
||||
PackConversion<int, int32_t>(aServerIf), aServiceHandle, aUuid,
|
||||
PackConversion<int, int32_t>(aServerIf), aServiceHandle,
|
||||
PackReversed<BluetoothUuid>(aUuid),
|
||||
PackConversion<BluetoothGattCharProp, int32_t>(aProperties),
|
||||
PackConversion<BluetoothGattAttrPerm, int32_t>(aPermissions), *pdu);
|
||||
if (NS_FAILED(rv)) {
|
||||
@ -856,7 +857,8 @@ BluetoothDaemonGattModule::ServerAddDescriptorCmd(
|
||||
4)); // Permissions
|
||||
|
||||
nsresult rv = PackPDU(
|
||||
PackConversion<int, int32_t>(aServerIf), aServiceHandle, aUuid,
|
||||
PackConversion<int, int32_t>(aServerIf), aServiceHandle,
|
||||
PackReversed<BluetoothUuid>(aUuid),
|
||||
PackConversion<BluetoothGattAttrPerm, int32_t>(aPermissions), *pdu);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
@ -1790,22 +1792,119 @@ BluetoothDaemonGattModule::ServerIncludedServiceAddedNtf(
|
||||
UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
// Init operator class for ServerCharacteristicAddedNotification
|
||||
class BluetoothDaemonGattModule::ServerCharacteristicAddedInitOp final
|
||||
: private PDUInitOp
|
||||
{
|
||||
public:
|
||||
ServerCharacteristicAddedInitOp(DaemonSocketPDU& aPDU)
|
||||
: PDUInitOp(aPDU)
|
||||
{ }
|
||||
|
||||
nsresult
|
||||
operator () (BluetoothGattStatus& aArg1,
|
||||
int& aArg2,
|
||||
BluetoothUuid& aArg3,
|
||||
BluetoothAttributeHandle& aArg4,
|
||||
BluetoothAttributeHandle& aArg5) const
|
||||
{
|
||||
DaemonSocketPDU& pdu = GetPDU();
|
||||
|
||||
/* Read GATT status */
|
||||
nsresult rv = UnpackPDU(pdu, aArg1);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
/* Read server interface */
|
||||
rv = UnpackPDU(pdu, aArg2);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
/* Read characteristic UUID */
|
||||
rv = UnpackPDU(pdu, UnpackReversed<BluetoothUuid>(aArg3));
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
/* Read service handle */
|
||||
rv = UnpackPDU(pdu, aArg4);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
/* Read characteristic handle */
|
||||
rv = UnpackPDU(pdu, aArg5);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
WarnAboutTrailingData();
|
||||
return NS_OK;
|
||||
}
|
||||
};
|
||||
|
||||
void
|
||||
BluetoothDaemonGattModule::ServerCharacteristicAddedNtf(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
|
||||
{
|
||||
ServerCharacteristicAddedNotification::Dispatch(
|
||||
&BluetoothGattNotificationHandler::CharacteristicAddedNotification,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
ServerCharacteristicAddedInitOp(aPDU));
|
||||
}
|
||||
|
||||
// Init operator class for ServerDescriptorAddedNotification
|
||||
class BluetoothDaemonGattModule::ServerDescriptorAddedInitOp final
|
||||
: private PDUInitOp
|
||||
{
|
||||
public:
|
||||
ServerDescriptorAddedInitOp(DaemonSocketPDU& aPDU)
|
||||
: PDUInitOp(aPDU)
|
||||
{ }
|
||||
|
||||
nsresult
|
||||
operator () (BluetoothGattStatus& aArg1,
|
||||
int& aArg2,
|
||||
BluetoothUuid& aArg3,
|
||||
BluetoothAttributeHandle& aArg4,
|
||||
BluetoothAttributeHandle& aArg5) const
|
||||
{
|
||||
DaemonSocketPDU& pdu = GetPDU();
|
||||
|
||||
/* Read GATT status */
|
||||
nsresult rv = UnpackPDU(pdu, aArg1);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
/* Read server interface */
|
||||
rv = UnpackPDU(pdu, aArg2);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
/* Read characteristic UUID */
|
||||
rv = UnpackPDU(pdu, UnpackReversed<BluetoothUuid>(aArg3));
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
/* Read service handle */
|
||||
rv = UnpackPDU(pdu, aArg4);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
/* Read descriptor handle */
|
||||
rv = UnpackPDU(pdu, aArg5);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
WarnAboutTrailingData();
|
||||
return NS_OK;
|
||||
}
|
||||
};
|
||||
void
|
||||
BluetoothDaemonGattModule::ServerDescriptorAddedNtf(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
|
||||
{
|
||||
ServerDescriptorAddedNotification::Dispatch(
|
||||
&BluetoothGattNotificationHandler::DescriptorAddedNotification,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
ServerDescriptorAddedInitOp(aPDU));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -676,6 +676,8 @@ protected:
|
||||
class ClientScanResultInitOp;
|
||||
class ServerConnectionInitOp;
|
||||
class ServerRequestWriteInitOp;
|
||||
class ServerCharacteristicAddedInitOp;
|
||||
class ServerDescriptorAddedInitOp;
|
||||
|
||||
void ClientRegisterNtf(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU);
|
||||
|
@ -324,20 +324,33 @@ BluetoothMapSmsManager::MasDataHandler(UnixSocketBuffer* aMessage)
|
||||
return;
|
||||
}
|
||||
|
||||
if (pktHeaders.Has(ObexHeaderId::Type)) {
|
||||
pktHeaders.GetContentType(type);
|
||||
BT_LOGR("Type: %s", NS_ConvertUTF16toUTF8(type).get());
|
||||
ReplyToPut();
|
||||
// Multi-packet PUT request (0x02) may not contain Type header
|
||||
if (!pktHeaders.Has(ObexHeaderId::Type)) {
|
||||
BT_LOGR("Missing OBEX PUT request Type header");
|
||||
SendReply(ObexResponseCode::BadRequest);
|
||||
return;
|
||||
}
|
||||
|
||||
if (type.EqualsLiteral("x-bt/MAP-NotificationRegistration")) {
|
||||
HandleNotificationRegistration(pktHeaders);
|
||||
} else if (type.EqualsLiteral("x-bt/MAP-event-report")) {
|
||||
HandleEventReport(pktHeaders);
|
||||
} else if (type.EqualsLiteral("x-bt/messageStatus")) {
|
||||
HandleSetMessageStatus(pktHeaders);
|
||||
} else if (type.EqualsLiteral("x-bt/message")) {
|
||||
HandleSmsMmsPushMessage(pktHeaders);
|
||||
}
|
||||
pktHeaders.GetContentType(type);
|
||||
BT_LOGR("Type: %s", NS_ConvertUTF16toUTF8(type).get());
|
||||
|
||||
if (type.EqualsLiteral("x-bt/MAP-NotificationRegistration")) {
|
||||
HandleNotificationRegistration(pktHeaders);
|
||||
ReplyToPut();
|
||||
} else if (type.EqualsLiteral("x-bt/messageStatus")) {
|
||||
HandleSetMessageStatus(pktHeaders);
|
||||
} else if (type.EqualsLiteral("x-bt/message")) {
|
||||
HandleSmsMmsPushMessage(pktHeaders);
|
||||
} else if (type.EqualsLiteral("x-bt/MAP-messageUpdate")) {
|
||||
/* MAP 5.9, There is no concept for Sms/Mms to update inbox. If the
|
||||
* MSE does NOT allowed the polling of its mailbox it shall answer
|
||||
* with a 'Not implemented' error response.
|
||||
*/
|
||||
SendReply(ObexResponseCode::NotImplemented);
|
||||
} else {
|
||||
BT_LOGR("Unknown MAP PUT request type: %s",
|
||||
NS_ConvertUTF16toUTF8(type).get());
|
||||
SendReply(ObexResponseCode::NotImplemented);
|
||||
}
|
||||
break;
|
||||
case ObexRequestCode::Get:
|
||||
@ -363,6 +376,12 @@ BluetoothMapSmsManager::MasDataHandler(UnixSocketBuffer* aMessage)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!pktHeaders.Has(ObexHeaderId::Type)) {
|
||||
BT_LOGR("Missing OBEX GET request Type header");
|
||||
SendReply(ObexResponseCode::BadRequest);
|
||||
return;
|
||||
}
|
||||
|
||||
pktHeaders.GetContentType(type);
|
||||
if (type.EqualsLiteral("x-obex/folder-listing")) {
|
||||
HandleSmsMmsFolderListing(pktHeaders);
|
||||
@ -371,8 +390,9 @@ BluetoothMapSmsManager::MasDataHandler(UnixSocketBuffer* aMessage)
|
||||
} else if (type.EqualsLiteral("x-bt/message")) {
|
||||
HandleSmsMmsGetMessage(pktHeaders);
|
||||
} else {
|
||||
BT_LOGR("Unknown MAP request type: %s",
|
||||
BT_LOGR("Unknown MAP GET request type: %s",
|
||||
NS_ConvertUTF16toUTF8(type).get());
|
||||
SendReply(ObexResponseCode::NotImplemented);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -400,24 +420,22 @@ BluetoothMapSmsManager::ReceiveSocketData(BluetoothSocket* aSocket,
|
||||
bool
|
||||
BluetoothMapSmsManager::CompareHeaderTarget(const ObexHeaderSet& aHeader)
|
||||
{
|
||||
if (!aHeader.Has(ObexHeaderId::Target)) {
|
||||
const ObexHeader* header = aHeader.GetHeader(ObexHeaderId::Target);
|
||||
|
||||
if (!header) {
|
||||
BT_LOGR("No ObexHeaderId::Target in header");
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t* targetPtr;
|
||||
int targetLength;
|
||||
aHeader.GetTarget(&targetPtr, &targetLength);
|
||||
|
||||
if (targetLength != sizeof(BluetoothUuid)) {
|
||||
BT_LOGR("Length mismatch: %d != 16", targetLength);
|
||||
if (header->mDataLength != sizeof(BluetoothUuid)) {
|
||||
BT_LOGR("Length mismatch: %d != 16", header->mDataLength);
|
||||
return false;
|
||||
}
|
||||
|
||||
for (uint8_t i = 0; i < sizeof(BluetoothUuid); i++) {
|
||||
if (targetPtr[i] != kMapMasObexTarget.mUuid[i]) {
|
||||
if (header->mData[i] != kMapMasObexTarget.mUuid[i]) {
|
||||
BT_LOGR("UUID mismatch: received target[%d]=0x%x != 0x%x",
|
||||
i, targetPtr[i], kMapMasObexTarget.mUuid[i]);
|
||||
i, header->mData[i], kMapMasObexTarget.mUuid[i]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -648,10 +666,9 @@ BluetoothMapSmsManager::ReplyToPut()
|
||||
|
||||
// Section 3.3.3.2 "PutResponse", IrOBEX 1.2
|
||||
// [opcode:1][length:2][Headers:var]
|
||||
uint8_t req[255];
|
||||
int index = 3;
|
||||
uint8_t req[kObexRespHeaderSize];
|
||||
|
||||
SendMasObexData(req, ObexResponseCode::Success, index);
|
||||
SendMasObexData(req, ObexResponseCode::Success, kObexRespHeaderSize);
|
||||
}
|
||||
|
||||
bool
|
||||
@ -828,15 +845,11 @@ BluetoothMapSmsManager::ReplyToSendMessage(
|
||||
*/
|
||||
int len = aHandleId.Length();
|
||||
nsAutoArrayPtr<uint8_t> handleId(new uint8_t[(len + 1) * 2]);
|
||||
const char16_t* handleIdPtr = aHandleId.BeginReading();
|
||||
|
||||
for (int i = 0; i < len; i++) {
|
||||
*(handleId + (i * 2)) = (uint8_t)(handleIdPtr[i] >> 8);
|
||||
*(handleId + (i * 2 + 1)) = (uint8_t)handleIdPtr[i];
|
||||
BigEndian::writeUint16(&handleId[i * 2], aHandleId[i]);
|
||||
}
|
||||
|
||||
*(handleId + (len * 2)) = 0x00;
|
||||
*(handleId + (len * 2 + 1)) = 0x00;
|
||||
BigEndian::writeUint16(&handleId[len * 2], 0);
|
||||
|
||||
auto res = MakeUnique<uint8_t[]>(mRemoteMaxPacketLength);
|
||||
int index = kObexRespHeaderSize;
|
||||
@ -1317,12 +1330,6 @@ BluetoothMapSmsManager::HandleNotificationRegistration(
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothMapSmsManager::HandleEventReport(const ObexHeaderSet& aHeader)
|
||||
{
|
||||
// TODO: Handle event report in Bug 1211769
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothMapSmsManager::HandleSetMessageStatus(const ObexHeaderSet& aHeader)
|
||||
{
|
||||
@ -1400,7 +1407,7 @@ BluetoothMapSmsManager::HandleSmsMmsPushMessage(const ObexHeaderSet& aHeader)
|
||||
nsCString subject;
|
||||
bmsg->GetBody(subject);
|
||||
// It's possible that subject is empty, send it anyway
|
||||
AppendNamedValue(data, "subject", subject);
|
||||
AppendNamedValue(data, "messageBody", subject);
|
||||
|
||||
nsTArray<RefPtr<VCard>> recipients;
|
||||
bmsg->GetRecipients(recipients);
|
||||
@ -1412,7 +1419,7 @@ BluetoothMapSmsManager::HandleSmsMmsPushMessage(const ObexHeaderSet& aHeader)
|
||||
AppendNamedValue(data, "recipient", recipient);
|
||||
}
|
||||
|
||||
bs->DistributeSignal(NS_LITERAL_STRING(MAP_PUSH_MESSAGE_REQ_ID),
|
||||
bs->DistributeSignal(NS_LITERAL_STRING(MAP_SEND_MESSAGE_REQ_ID),
|
||||
NS_LITERAL_STRING(KEY_ADAPTER), data);
|
||||
}
|
||||
|
||||
@ -1442,9 +1449,9 @@ BluetoothMapSmsManager::SendReply(uint8_t aResponseCode)
|
||||
|
||||
// Section 3.2 "Response Format", IrOBEX 1.2
|
||||
// [opcode:1][length:2][Headers:var]
|
||||
uint8_t req[3];
|
||||
uint8_t req[kObexRespHeaderSize];
|
||||
|
||||
SendMasObexData(req, aResponseCode, 3);
|
||||
SendMasObexData(req, aResponseCode, kObexRespHeaderSize);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -212,7 +212,6 @@ private:
|
||||
void SendReply(uint8_t aResponse);
|
||||
|
||||
void HandleNotificationRegistration(const ObexHeaderSet& aHeader);
|
||||
void HandleEventReport(const ObexHeaderSet& aHeader);
|
||||
void HandleSetMessageStatus(const ObexHeaderSet& aHeader);
|
||||
void HandleSmsMmsFolderListing(const ObexHeaderSet& aHeader);
|
||||
void HandleSmsMmsMsgListing(const ObexHeaderSet& aHeader);
|
||||
|
@ -1205,20 +1205,16 @@ BluetoothOppManager::SendPutHeaderRequest(const nsAString& aFileName,
|
||||
return;
|
||||
}
|
||||
|
||||
auto req = MakeUnique<uint8_t[]>(mRemoteMaxPacketLength);
|
||||
|
||||
int len = aFileName.Length();
|
||||
uint8_t* fileName = new uint8_t[(len + 1) * 2];
|
||||
const char16_t* fileNamePtr = aFileName.BeginReading();
|
||||
nsAutoArrayPtr<uint8_t> fileName(new uint8_t[(len + 1) * 2]);
|
||||
|
||||
for (int i = 0; i < len; i++) {
|
||||
fileName[i * 2] = (uint8_t)(fileNamePtr[i] >> 8);
|
||||
fileName[i * 2 + 1] = (uint8_t)fileNamePtr[i];
|
||||
BigEndian::writeUint16(&fileName[i * 2], aFileName[i]);
|
||||
}
|
||||
BigEndian::writeUint16(&fileName[len * 2], 0);
|
||||
|
||||
fileName[len * 2] = 0x00;
|
||||
fileName[len * 2 + 1] = 0x00;
|
||||
|
||||
// Prepare packet
|
||||
auto req = MakeUnique<uint8_t[]>(mRemoteMaxPacketLength);
|
||||
int index = 3;
|
||||
index += AppendHeaderName(&req[index], mRemoteMaxPacketLength - index,
|
||||
fileName, (len + 1) * 2);
|
||||
@ -1228,8 +1224,6 @@ BluetoothOppManager::SendPutHeaderRequest(const nsAString& aFileName,
|
||||
uint8_t opcode = (aFileSize > 0) ? ObexRequestCode::Put
|
||||
: ObexRequestCode::PutFinal;
|
||||
SendObexData(Move(req), opcode, index);
|
||||
|
||||
delete [] fileName;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -357,24 +357,22 @@ BluetoothPbapManager::ReceiveSocketData(BluetoothSocket* aSocket,
|
||||
bool
|
||||
BluetoothPbapManager::CompareHeaderTarget(const ObexHeaderSet& aHeader)
|
||||
{
|
||||
if (!aHeader.Has(ObexHeaderId::Target)) {
|
||||
const ObexHeader* header = aHeader.GetHeader(ObexHeaderId::Target);
|
||||
|
||||
if (!header) {
|
||||
BT_LOGR("No ObexHeaderId::Target in header");
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t* targetPtr;
|
||||
int targetLength;
|
||||
aHeader.GetTarget(&targetPtr, &targetLength);
|
||||
|
||||
if (targetLength != sizeof(BluetoothUuid)) {
|
||||
BT_LOGR("Length mismatch: %d != 16", targetLength);
|
||||
if (header->mDataLength != sizeof(BluetoothUuid)) {
|
||||
BT_LOGR("Length mismatch: %d != 16", header->mDataLength);
|
||||
return false;
|
||||
}
|
||||
|
||||
for (uint8_t i = 0; i < sizeof(BluetoothUuid); i++) {
|
||||
if (targetPtr[i] != kPbapObexTarget.mUuid[i]) {
|
||||
if (header->mData[i] != kPbapObexTarget.mUuid[i]) {
|
||||
BT_LOGR("UUID mismatch: received target[%d]=0x%x != 0x%x",
|
||||
i, targetPtr[i], kPbapObexTarget.mUuid[i]);
|
||||
i, header->mData[i], kPbapObexTarget.mUuid[i]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ extern bool gBluetoothDebugFlag;
|
||||
#define MAP_MESSAGES_LISTING_REQ_ID "mapmessageslistingreq"
|
||||
#define MAP_GET_MESSAGE_REQ_ID "mapgetmessagereq"
|
||||
#define MAP_SET_MESSAGE_STATUS_REQ_ID "mapsetmessagestatusreq"
|
||||
#define MAP_PUSH_MESSAGE_REQ_ID "mappushmessagereq"
|
||||
#define MAP_SEND_MESSAGE_REQ_ID "mapsendmessagereq"
|
||||
#define MAP_FOLDER_LISTING_REQ_ID "mapfolderlistingreq"
|
||||
#define MAP_MESSAGE_UPDATE_REQ_ID "mapmessageupdatereq"
|
||||
|
||||
|
@ -248,23 +248,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void GetTarget(uint8_t** aRetTarget, int* aRetTargetLength) const
|
||||
{
|
||||
int length = mHeaders.Length();
|
||||
*aRetTarget = nullptr;
|
||||
*aRetTargetLength = 0;
|
||||
|
||||
for (int i = 0; i < length; ++i) {
|
||||
if (mHeaders[i]->mId == ObexHeaderId::Target) {
|
||||
uint8_t* ptr = mHeaders[i]->mData.get();
|
||||
*aRetTarget = new uint8_t[mHeaders[i]->mDataLength];
|
||||
memcpy(*aRetTarget, ptr, mHeaders[i]->mDataLength);
|
||||
*aRetTargetLength = mHeaders[i]->mDataLength;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GetAuthChallenge(nsAutoArrayPtr<uint8_t>& aRetData,
|
||||
int* aRetDataLength) const
|
||||
{
|
||||
@ -343,16 +326,20 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Has(ObexHeaderId aId) const
|
||||
const ObexHeader* GetHeader(ObexHeaderId aId) const
|
||||
{
|
||||
int length = mHeaders.Length();
|
||||
for (int i = 0; i < length; ++i) {
|
||||
for (int i = 0, length = mHeaders.Length(); i < length; ++i) {
|
||||
if (mHeaders[i]->mId == aId) {
|
||||
return true;
|
||||
return mHeaders[i];
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool Has(ObexHeaderId aId) const
|
||||
{
|
||||
return !!GetHeader(aId);
|
||||
}
|
||||
|
||||
void ClearHeaders()
|
||||
|
@ -567,7 +567,7 @@ BluetoothAdapter::Notify(const BluetoothSignal& aData)
|
||||
HandleMapGetMessage(aData.value());
|
||||
} else if (aData.name().EqualsLiteral(MAP_SET_MESSAGE_STATUS_REQ_ID)) {
|
||||
HandleMapSetMessageStatus(aData.value());
|
||||
} else if (aData.name().EqualsLiteral(MAP_PUSH_MESSAGE_REQ_ID)) {
|
||||
} else if (aData.name().EqualsLiteral(MAP_SEND_MESSAGE_REQ_ID)) {
|
||||
HandleMapSendMessage(aData.value());
|
||||
} else if (aData.name().EqualsLiteral(MAP_MESSAGE_UPDATE_REQ_ID)) {
|
||||
HandleMapMessageUpdate(aData.value());
|
||||
@ -1596,9 +1596,9 @@ BluetoothAdapter::HandleMapSendMessage(const BluetoothValue& aValue)
|
||||
const nsString& name = arr[i].name();
|
||||
const BluetoothValue& value = arr[i].value();
|
||||
if (name.EqualsLiteral("recipient")) {
|
||||
init.mRecipient = value.get_nsString();
|
||||
init.mRecipient = NS_ConvertUTF8toUTF16(value.get_nsCString());
|
||||
} else if (name.EqualsLiteral("messageBody")) {
|
||||
init.mMessageBody = value.get_nsString();
|
||||
init.mMessageBody = NS_ConvertUTF8toUTF16(value.get_nsCString());
|
||||
} else if (name.EqualsLiteral("retry")) {
|
||||
init.mRetry = value.get_uint32_t();
|
||||
}
|
||||
@ -1608,7 +1608,7 @@ BluetoothAdapter::HandleMapSendMessage(const BluetoothValue& aValue)
|
||||
|
||||
RefPtr<BluetoothMapSendMessageEvent> event =
|
||||
BluetoothMapSendMessageEvent::Constructor(this,
|
||||
NS_LITERAL_STRING(MAP_PUSH_MESSAGE_REQ_ID), init);
|
||||
NS_LITERAL_STRING(MAP_SEND_MESSAGE_REQ_ID), init);
|
||||
DispatchTrustedEvent(event);
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@ browserElementTestHelpers.setEnabledPref(true);
|
||||
browserElementTestHelpers.addPermission();
|
||||
|
||||
function noaudio() {
|
||||
info("Test : no-audio");
|
||||
var iframe = document.createElement('iframe');
|
||||
iframe.setAttribute('mozbrowser', 'true');
|
||||
iframe.setAttribute('mozapp', 'http://example.org/manifest.webapp');
|
||||
@ -143,6 +144,7 @@ function noaudio() {
|
||||
}
|
||||
|
||||
function audio() {
|
||||
info("Test : audio");
|
||||
var iframe = document.createElement('iframe');
|
||||
iframe.setAttribute('mozbrowser', 'true');
|
||||
iframe.setAttribute('mozapp', 'http://example.org/manifest.webapp');
|
||||
@ -179,7 +181,60 @@ function audio() {
|
||||
document.body.appendChild(iframe);
|
||||
}
|
||||
|
||||
var tests = [ noaudio, audio ];
|
||||
function audioMutedByDefault() {
|
||||
info("Test : audio-muted-by-default");
|
||||
SpecialPowers.pushPrefEnv(
|
||||
{'set': [["dom.audiochannel.mutedByDefault", true]]}, function () {
|
||||
var iframe = document.createElement('iframe');
|
||||
iframe.setAttribute('mozbrowser', 'true');
|
||||
iframe.setAttribute('mozapp', 'http://example.org/manifest.webapp');
|
||||
iframe.src = 'http://example.org/tests/dom/browser-element/mochitest/file_processingAudioSample.html';
|
||||
|
||||
function audio_loadend_MutedByDefault() {
|
||||
ok("allowedAudioChannels" in iframe, "allowedAudioChannels exist");
|
||||
var channels = iframe.allowedAudioChannels;
|
||||
is(channels.length, 1, "1 audio channel by default");
|
||||
|
||||
var ac = channels[0];
|
||||
|
||||
ok(ac instanceof BrowserElementAudioChannel, "Correct class");
|
||||
ok("getMuted" in ac, "ac.getMuted exists");
|
||||
ok("setMuted" in ac, "ac.setMuted exists");
|
||||
|
||||
ac.onactivestatechanged = function() {
|
||||
ok(true, "activestatechanged event received.");
|
||||
ac.onactivestatechanged = null;
|
||||
|
||||
new Promise(function(r, rr) {
|
||||
ac.getMuted().onsuccess = function(e) {
|
||||
is(e.target.result, true, "Muted channel by default");
|
||||
r();
|
||||
}
|
||||
})
|
||||
.then(function() {
|
||||
ac.setMuted(false).onsuccess = function(e) {
|
||||
ok(true, "Unmuted the channel.");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
var complete = false;
|
||||
iframe.addEventListener("mozbrowsershowmodalprompt", function (e) {
|
||||
is(e.detail.message, "playback-success", "Audio playback success!");
|
||||
if (!complete) {
|
||||
document.body.removeChild(iframe);
|
||||
SpecialPowers.popPrefEnv(runTests);
|
||||
complete = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
iframe.addEventListener('mozbrowserloadend', audio_loadend_MutedByDefault);
|
||||
document.body.appendChild(iframe);
|
||||
});
|
||||
}
|
||||
|
||||
var tests = [ noaudio, audio, audioMutedByDefault ];
|
||||
|
||||
function runTests() {
|
||||
if (tests.length == 0) {
|
||||
@ -191,8 +246,6 @@ function runTests() {
|
||||
test();
|
||||
}
|
||||
|
||||
|
||||
addEventListener('load', function() {
|
||||
SimpleTest.executeSoon(runTests);
|
||||
});
|
||||
|
||||
|
@ -0,0 +1,45 @@
|
||||
<html>
|
||||
<body>
|
||||
<script>
|
||||
var audio = new Audio("audio.ogg");
|
||||
var context = new AudioContext();
|
||||
var node = context.createMediaElementSource(audio);
|
||||
var sp = context.createScriptProcessor(2048, 1);
|
||||
node.connect(sp);
|
||||
var expectedSamplesCount;
|
||||
var nonzeroSamplesCount = 0;
|
||||
var complete = false;
|
||||
var iterationCount = 0;
|
||||
|
||||
function processSamples(e) {
|
||||
if (complete) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Start playing the audio until the AudioContext is connected and running.
|
||||
if (iterationCount++ == 0) {
|
||||
audio.play();
|
||||
}
|
||||
|
||||
var buf = e.inputBuffer.getChannelData(0);
|
||||
for (var i = 0; i < buf.length; ++i) {
|
||||
if (buf[i] != 0) {
|
||||
nonzeroSamplesCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (nonzeroSamplesCount >= expectedSamplesCount && !complete) {
|
||||
alert("playback-success");
|
||||
complete = true;
|
||||
}
|
||||
}
|
||||
|
||||
audio.oncanplaythrough = function() {
|
||||
var testDuration = audio.duration > 2.0 ? 2.0 : audio.duration;
|
||||
expectedSamplesCount = Math.floor(testDuration * context.sampleRate) ;
|
||||
sp.onaudioprocess = processSamples;
|
||||
};
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -140,6 +140,7 @@ support-files =
|
||||
file_web_manifest.html
|
||||
file_web_manifest.json
|
||||
file_illegal_web_manifest.html
|
||||
file_processingAudioSample.html
|
||||
|
||||
# Note: browserElementTestHelpers.js looks at the test's filename to determine
|
||||
# whether the test should be OOP. "_oop_" signals OOP, "_inproc_" signals in
|
||||
|
@ -1204,6 +1204,13 @@ bool CanvasRenderingContext2D::SwitchRenderingMode(RenderingMode aRenderingMode)
|
||||
}
|
||||
|
||||
#ifdef USE_SKIA_GPU
|
||||
// Do not attempt to switch into GL mode if the platform doesn't allow it.
|
||||
if ((aRenderingMode == RenderingMode::OpenGLBackendMode) &&
|
||||
(!gfxPlatform::GetPlatform()->HaveChoiceOfHWAndSWCanvas() ||
|
||||
!gfxPlatform::GetPlatform()->UseAcceleratedSkiaCanvas())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mRenderingMode == RenderingMode::OpenGLBackendMode) {
|
||||
if (mVideoTexture) {
|
||||
gfxPlatform::GetPlatform()->GetSkiaGLGlue()->GetGLContext()->MakeCurrent();
|
||||
|
@ -202,9 +202,10 @@ HTMLAllCollection::GetSupportedNames(unsigned aFlags, nsTArray<nsString>& aNames
|
||||
}
|
||||
}
|
||||
|
||||
aNames.SetCapacity(atoms.Length());
|
||||
for (uint32_t i = 0; i < atoms.Length(); ++i) {
|
||||
aNames.AppendElement(nsDependentAtomString(atoms[i]));
|
||||
uint32_t atomsLen = atoms.Length();
|
||||
nsString* names = aNames.AppendElements(atomsLen);
|
||||
for (uint32_t i = 0; i < atomsLen; ++i) {
|
||||
atoms[i]->ToString(names[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2154,10 +2154,13 @@ HTMLInputElement::MozSetFileNameArray(const char16_t** aFileNames, uint32_t aLen
|
||||
}
|
||||
|
||||
Sequence<nsString> list;
|
||||
nsString* names = list.AppendElements(aLength, fallible);
|
||||
if (!names) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
for (uint32_t i = 0; i < aLength; ++i) {
|
||||
if (!list.AppendElement(nsDependentString(aFileNames[i]), fallible)) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
const char16_t* filename = aFileNames[i];
|
||||
names[i].Rebind(filename, nsCharTraits<char16_t>::length(filename));
|
||||
}
|
||||
|
||||
ErrorResult rv;
|
||||
|
@ -309,9 +309,10 @@ HTMLOptionsCollection::GetSupportedNames(unsigned aFlags,
|
||||
}
|
||||
}
|
||||
|
||||
aNames.SetCapacity(atoms.Length());
|
||||
for (uint32_t i = 0; i < atoms.Length(); ++i) {
|
||||
aNames.AppendElement(nsDependentAtomString(atoms[i]));
|
||||
uint32_t atomsLen = atoms.Length();
|
||||
nsString* names = aNames.AppendElements(atomsLen);
|
||||
for (uint32_t i = 0; i < atomsLen; ++i) {
|
||||
atoms[i]->ToString(names[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1584,7 +1584,7 @@ ContentParent::ForwardKnownInfo()
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
InfallibleTArray<VolumeInfo> volumeInfo;
|
||||
RefPtr<nsVolumeService> vs = nsVolumeService::GetSingleton();
|
||||
if (vs && !mIsForBrowser) {
|
||||
if (vs) {
|
||||
vs->GetVolumesForIPC(&volumeInfo);
|
||||
Unused << SendVolumes(volumeInfo);
|
||||
}
|
||||
|
@ -455,8 +455,7 @@ public:
|
||||
size_t
|
||||
SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t amount = mEncoder->SizeOfExcludingThis(aMallocSizeOf);
|
||||
return amount;
|
||||
return (mEncoder ? mEncoder->SizeOfExcludingThis(aMallocSizeOf) : 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -14,3 +14,5 @@ qemu=true
|
||||
[test_nfc_read_tag.js]
|
||||
[test_nfc_checkP2PRegistration.js]
|
||||
[test_nfc_error_messages.js]
|
||||
[test_nfc_tag_found.js]
|
||||
[test_nfc_tag_lost.js]
|
||||
|
46
dom/nfc/tests/marionette/test_nfc_tag_found.js
Normal file
46
dom/nfc/tests/marionette/test_nfc_tag_found.js
Normal file
@ -0,0 +1,46 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
MARIONETTE_TIMEOUT = 30000;
|
||||
MARIONETTE_HEAD_JS = 'head.js';
|
||||
|
||||
function handleTechnologyDiscoveredRE0(msg) {
|
||||
log('Received \'nfc-manager-tech-discovered\'');
|
||||
ok(msg.peer, 'check for correct tech type');
|
||||
|
||||
deactivateAndWaitForTechLost().then(() => toggleNFC(false)).then(runNextTest);
|
||||
}
|
||||
|
||||
function tagFoundCb(evt) {
|
||||
log("tagFoundCb called ");
|
||||
ok(evt.tag instanceof MozNFCTag, "Should get a NFCTag object.");
|
||||
|
||||
nfc.ontagfound = null;
|
||||
deactivateAndWaitForTechLost().then(() => toggleNFC(false)).then(runNextTest);
|
||||
}
|
||||
|
||||
function tagFoundErrorCb(evt) {
|
||||
ok(false, "ontagfound shouldn't be called");
|
||||
}
|
||||
|
||||
function testTagFound() {
|
||||
nfc.ontagfound = tagFoundCb;
|
||||
|
||||
toggleNFC(true).then(() => NCI.activateRE(emulator.T1T_RE_INDEX));
|
||||
}
|
||||
|
||||
function testTagFoundShouldNotFired() {
|
||||
nfc.ontagfound = tagFoundErrorCb;
|
||||
sysMsgHelper.waitForTechDiscovered(handleTechnologyDiscoveredRE0);
|
||||
|
||||
toggleNFC(true).then(() => NCI.activateRE(emulator.P2P_RE_INDEX_0));
|
||||
}
|
||||
|
||||
var tests = [
|
||||
testTagFound,
|
||||
testTagFoundShouldNotFired
|
||||
];
|
||||
|
||||
SpecialPowers.pushPermissions(
|
||||
[{"type": "nfc", "allow": true, context: document},
|
||||
{'type': 'nfc-manager', 'allow': true, context: document}], runTests);
|
36
dom/nfc/tests/marionette/test_nfc_tag_lost.js
Normal file
36
dom/nfc/tests/marionette/test_nfc_tag_lost.js
Normal file
@ -0,0 +1,36 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
MARIONETTE_TIMEOUT = 30000;
|
||||
MARIONETTE_HEAD_JS = 'head.js';
|
||||
|
||||
function tagFoundCb(evt) {
|
||||
log("tagFoundCb called ");
|
||||
ok(evt.tag instanceof MozNFCTag, "Should get a NFCTag object.");
|
||||
|
||||
NCI.deactivate();
|
||||
}
|
||||
|
||||
function tagLostCb(evt) {
|
||||
log("tagLostCb called ");
|
||||
ok(true);
|
||||
|
||||
nfc.ontagfound = null;
|
||||
nfc.ontaglost = null;
|
||||
toggleNFC(false).then(runNextTest);
|
||||
}
|
||||
|
||||
function testTagLost() {
|
||||
nfc.ontagfound = tagFoundCb;
|
||||
nfc.ontaglost = tagLostCb;
|
||||
|
||||
toggleNFC(true).then(() => NCI.activateRE(emulator.T1T_RE_INDEX));
|
||||
}
|
||||
|
||||
var tests = [
|
||||
testTagLost
|
||||
];
|
||||
|
||||
SpecialPowers.pushPermissions(
|
||||
[{"type": "nfc", "allow": true, context: document},
|
||||
{'type': 'nfc-manager', 'allow': true, context: document}], runTests);
|
@ -333,12 +333,15 @@ QuotaManagerService::InitiateRequest(nsAutoPtr<PendingRequestInfo>& aInfo)
|
||||
}
|
||||
|
||||
if (!mBackgroundActor && mPendingRequests.IsEmpty()) {
|
||||
// We need to start the sequence to create a background actor for this
|
||||
// thread.
|
||||
|
||||
RefPtr<BackgroundCreateCallback> cb = new BackgroundCreateCallback(this);
|
||||
if (NS_WARN_IF(!BackgroundChild::GetOrCreateForCurrentThread(cb))) {
|
||||
return NS_ERROR_FAILURE;
|
||||
if (PBackgroundChild* actor = BackgroundChild::GetForCurrentThread()) {
|
||||
BackgroundActorCreated(actor);
|
||||
} else {
|
||||
// We need to start the sequence to create a background actor for this
|
||||
// thread.
|
||||
RefPtr<BackgroundCreateCallback> cb = new BackgroundCreateCallback(this);
|
||||
if (NS_WARN_IF(!BackgroundChild::GetOrCreateForCurrentThread(cb))) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
[DEFAULT]
|
||||
skip-if = e10s
|
||||
support-files =
|
||||
file_app.template.webapp
|
||||
file_app.sjs
|
||||
@ -15,7 +14,7 @@ skip-if = os == "android" || toolkit == "gonk"
|
||||
[test_basic.html]
|
||||
skip-if = os == "android" || toolkit == "gonk"
|
||||
[test_basic_app.html]
|
||||
skip-if = os == "android" || buildapp == 'b2g'
|
||||
skip-if = os == "android" || buildapp == 'b2g' || e10s # mozapps
|
||||
[test_wakeUp.html]
|
||||
run-if = buildapp == 'b2g' && toolkit == 'gonk'
|
||||
[test_runNow.html]
|
||||
|
@ -24,9 +24,7 @@
|
||||
},
|
||||
|
||||
function() {
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/RequestSyncService.jsm");
|
||||
}
|
||||
SpecialPowers.importInMainProcess("resource://gre/modules/RequestSyncService.jsm");
|
||||
runTests();
|
||||
},
|
||||
|
||||
|
@ -85,10 +85,7 @@
|
||||
},
|
||||
|
||||
function() {
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/RequestSyncService.jsm");
|
||||
}
|
||||
|
||||
SpecialPowers.importInMainProcess("resource://gre/modules/RequestSyncService.jsm");
|
||||
SpecialPowers.setAllAppsLaunchable(true);
|
||||
SpecialPowers.pushPrefEnv({"set":[["dom.mozBrowserFramesEnabled", true]]}, runTests);
|
||||
},
|
||||
|
@ -24,9 +24,7 @@
|
||||
},
|
||||
|
||||
function() {
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/RequestSyncService.jsm");
|
||||
}
|
||||
SpecialPowers.importInMainProcess("resource://gre/modules/RequestSyncService.jsm");
|
||||
runTests();
|
||||
},
|
||||
|
||||
|
@ -30,9 +30,7 @@
|
||||
|
||||
var tests = [
|
||||
function() {
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/RequestSyncService.jsm");
|
||||
}
|
||||
SpecialPowers.importInMainProcess("resource://gre/modules/RequestSyncService.jsm");
|
||||
runTests();
|
||||
},
|
||||
|
||||
|
@ -93,9 +93,7 @@
|
||||
},
|
||||
|
||||
function() {
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/RequestSyncService.jsm");
|
||||
}
|
||||
SpecialPowers.importInMainProcess("resource://gre/modules/RequestSyncService.jsm");
|
||||
runTests();
|
||||
},
|
||||
|
||||
|
@ -154,9 +154,7 @@
|
||||
},
|
||||
|
||||
function() {
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/RequestSyncService.jsm");
|
||||
}
|
||||
SpecialPowers.importInMainProcess("resource://gre/modules/RequestSyncService.jsm");
|
||||
runTests();
|
||||
},
|
||||
|
||||
|
@ -121,8 +121,10 @@ TelephonyDialCallback::NotifyDialMMISuccessWithStrings(const nsAString& aStatusM
|
||||
result.mStatusMessage.Assign(aStatusMessage);
|
||||
|
||||
nsTArray<nsString> additionalInformation;
|
||||
nsString* infos = additionalInformation.AppendElements(aCount);
|
||||
for (uint32_t i = 0; i < aCount; i++) {
|
||||
additionalInformation.AppendElement(nsDependentString(aAdditionalInformation[i]));
|
||||
infos[i].Rebind(aAdditionalInformation[i],
|
||||
nsCharTraits<char16_t>::length(aAdditionalInformation[i]));
|
||||
}
|
||||
|
||||
JS::Rooted<JS::Value> jsAdditionalInformation(cx);
|
||||
|
@ -483,8 +483,10 @@ TelephonyRequestParent::DialCallback::NotifyDialMMISuccessWithStrings(const nsAS
|
||||
const char16_t** aAdditionalInformation)
|
||||
{
|
||||
nsTArray<nsString> additionalInformation;
|
||||
nsString* infos = additionalInformation.AppendElements(aCount);
|
||||
for (uint32_t i = 0; i < aCount; i++) {
|
||||
additionalInformation.AppendElement(nsDependentString(aAdditionalInformation[i]));
|
||||
infos[i].Rebind(aAdditionalInformation[i],
|
||||
nsCharTraits<char16_t>::length(aAdditionalInformation[i]));
|
||||
}
|
||||
|
||||
return SendResponse(DialResponseMMISuccess(nsAutoString(aStatusMessage),
|
||||
|
@ -28,9 +28,7 @@ resume_geolocationProvider(function() {
|
||||
force_prompt(true, test1);
|
||||
});
|
||||
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/SettingsRequestManager.jsm");
|
||||
}
|
||||
SpecialPowers.importInMainProcess("resource://gre/modules/SettingsRequestManager.jsm");
|
||||
|
||||
function test1() {
|
||||
//This pushPermissions call is after pushPrefEnv call and pushPrefEnv calls follow after this
|
||||
@ -47,7 +45,7 @@ function test2() {
|
||||
toggleGeolocationSetting(false, function() {
|
||||
ok(true, "turned off geolocation via mozSettings");
|
||||
setTimeout(function() {
|
||||
navigator.geolocation.getCurrentPosition(successCallbackAfterMozsettingOff,
|
||||
navigator.geolocation.getCurrentPosition(successCallbackAfterMozsettingOff,
|
||||
failureCallbackAfterMozsettingOff);
|
||||
}, timeToWaitMs); // need to wait a bit for all of these async callbacks to finish
|
||||
});
|
||||
|
@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=478911
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=777594">Mozilla Bug 777594</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
@ -26,9 +26,7 @@ resume_geolocationProvider(function() {
|
||||
force_prompt(true, test1);
|
||||
});
|
||||
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/SettingsRequestManager.jsm");
|
||||
}
|
||||
SpecialPowers.importInMainProcess("resource://gre/modules/SettingsRequestManager.jsm");
|
||||
|
||||
function test1() {
|
||||
//This pushPermissions call is after pushPrefEnv call and pushPrefEnv calls follow after this
|
||||
@ -46,8 +44,8 @@ function test2() {
|
||||
toggleGeolocationSetting(false, function() {
|
||||
ok(true, "turned off geolocation via mozSettings");
|
||||
setTimeout(function() {
|
||||
watchId = navigator.geolocation.watchPosition(successCallbackAfterMozsettingOff,
|
||||
failureCallbackAfterMozsettingOff);
|
||||
watchId = navigator.geolocation.watchPosition(successCallbackAfterMozsettingOff,
|
||||
failureCallbackAfterMozsettingOff);
|
||||
}, 500); // need to wait a bit for all of these async callbacks to finish
|
||||
});
|
||||
}
|
||||
|
@ -124,11 +124,6 @@ public:
|
||||
nsIURI* aDocumentURI,
|
||||
const nsTArray<RefPtr<mozilla::dom::NodeInfo>> *aNodeInfos) = 0;
|
||||
|
||||
#ifdef NS_BUILD_REFCNT_LOGGING
|
||||
virtual const char* ClassName() = 0;
|
||||
virtual uint32_t ClassSize() = 0;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The prototype document must call ReleaseSubtree when it is going
|
||||
* away. This makes the parents through the tree stop owning their
|
||||
@ -166,11 +161,6 @@ public:
|
||||
Unlink();
|
||||
}
|
||||
|
||||
#ifdef NS_BUILD_REFCNT_LOGGING
|
||||
virtual const char* ClassName() override { return "nsXULPrototypeElement"; }
|
||||
virtual uint32_t ClassSize() override { return sizeof(*this); }
|
||||
#endif
|
||||
|
||||
virtual void ReleaseSubtree() override
|
||||
{
|
||||
for (int32_t i = mChildren.Length() - 1; i >= 0; i--) {
|
||||
@ -219,11 +209,6 @@ public:
|
||||
nsXULPrototypeScript(uint32_t aLineNo, uint32_t version);
|
||||
virtual ~nsXULPrototypeScript();
|
||||
|
||||
#ifdef NS_BUILD_REFCNT_LOGGING
|
||||
virtual const char* ClassName() override { return "nsXULPrototypeScript"; }
|
||||
virtual uint32_t ClassSize() override { return sizeof(*this); }
|
||||
#endif
|
||||
|
||||
virtual nsresult Serialize(nsIObjectOutputStream* aStream,
|
||||
nsXULPrototypeDocument* aProtoDoc,
|
||||
const nsTArray<RefPtr<mozilla::dom::NodeInfo>> *aNodeInfos) override;
|
||||
@ -298,11 +283,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef NS_BUILD_REFCNT_LOGGING
|
||||
virtual const char* ClassName() override { return "nsXULPrototypeText"; }
|
||||
virtual uint32_t ClassSize() override { return sizeof(*this); }
|
||||
#endif
|
||||
|
||||
virtual nsresult Serialize(nsIObjectOutputStream* aStream,
|
||||
nsXULPrototypeDocument* aProtoDoc,
|
||||
const nsTArray<RefPtr<mozilla::dom::NodeInfo>> *aNodeInfos) override;
|
||||
@ -326,11 +306,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef NS_BUILD_REFCNT_LOGGING
|
||||
virtual const char* ClassName() override { return "nsXULPrototypePI"; }
|
||||
virtual uint32_t ClassSize() override { return sizeof(*this); }
|
||||
#endif
|
||||
|
||||
virtual nsresult Serialize(nsIObjectOutputStream* aStream,
|
||||
nsXULPrototypeDocument* aProtoDoc,
|
||||
const nsTArray<RefPtr<mozilla::dom::NodeInfo>> *aNodeInfos) override;
|
||||
|
@ -1,4 +1,4 @@
|
||||
54852
|
||||
54853
|
||||
0/nm
|
||||
0th/pt
|
||||
1/n1
|
||||
@ -52939,6 +52939,7 @@ valid/Y
|
||||
validate/IGNDS
|
||||
validation/IM
|
||||
validations
|
||||
validator/S
|
||||
validity/IM
|
||||
validness/M
|
||||
valise/SM
|
||||
|
@ -375,9 +375,11 @@ NS_IMETHODIMP mozPersonalDictionary::Save()
|
||||
return res;
|
||||
}
|
||||
|
||||
nsTArray<nsString> array(mDictionaryTable.Count());
|
||||
nsTArray<nsString> array;
|
||||
nsString* elems = array.AppendElements(mDictionaryTable.Count());
|
||||
for (auto iter = mDictionaryTable.Iter(); !iter.Done(); iter.Next()) {
|
||||
array.AppendElement(nsDependentString(iter.Get()->GetKey()));
|
||||
elems->Assign(iter.Get()->GetKey());
|
||||
elems++;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIRunnable> runnable =
|
||||
@ -396,9 +398,11 @@ NS_IMETHODIMP mozPersonalDictionary::GetWordList(nsIStringEnumerator **aWords)
|
||||
|
||||
WaitForLoad();
|
||||
|
||||
nsTArray<nsString> *array = new nsTArray<nsString>(mDictionaryTable.Count());
|
||||
nsTArray<nsString> *array = new nsTArray<nsString>();
|
||||
nsString* elems = array->AppendElements(mDictionaryTable.Count());
|
||||
for (auto iter = mDictionaryTable.Iter(); !iter.Done(); iter.Next()) {
|
||||
array->AppendElement(nsDependentString(iter.Get()->GetKey()));
|
||||
elems->Assign(iter.Get()->GetKey());
|
||||
elems++;
|
||||
}
|
||||
|
||||
array->Sort();
|
||||
|
@ -153,9 +153,10 @@ mozSpellChecker::CheckWord(const nsAString &aWord, bool *aIsMisspelled, nsTArray
|
||||
char16_t **words;
|
||||
|
||||
result = mSpellCheckingEngine->Suggest(PromiseFlatString(aWord).get(), &words, &count);
|
||||
NS_ENSURE_SUCCESS(result, result);
|
||||
NS_ENSURE_SUCCESS(result, result);
|
||||
nsString* suggestions = aSuggestions->AppendElements(count);
|
||||
for(i=0;i<count;i++){
|
||||
aSuggestions->AppendElement(nsDependentString(words[i]));
|
||||
suggestions[i].Assign(words[i]);
|
||||
}
|
||||
|
||||
if (count)
|
||||
|
@ -656,16 +656,20 @@ DrawTargetSkia::MaskSurface(const Pattern &aSource,
|
||||
|
||||
TempBitmap bitmap = GetBitmapForSurface(aMask);
|
||||
if (bitmap.mBitmap.colorType() == kAlpha_8_SkColorType) {
|
||||
if (aOffset != Point(0, 0)) {
|
||||
SkMatrix transform;
|
||||
transform.setTranslate(SkFloatToScalar(-aOffset.x), SkFloatToScalar(-aOffset.y));
|
||||
SkShader* matrixShader = SkShader::CreateLocalMatrixShader(paint.mPaint.getShader(), transform);
|
||||
SkSafeUnref(paint.mPaint.setShader(matrixShader));
|
||||
}
|
||||
|
||||
mCanvas->drawBitmap(bitmap.mBitmap, aOffset.x, aOffset.y, &paint.mPaint);
|
||||
} else {
|
||||
SkPaint maskPaint;
|
||||
TempBitmap tmpBitmap;
|
||||
SetPaintPattern(maskPaint, SurfacePattern(aMask, ExtendMode::CLAMP), tmpBitmap);
|
||||
|
||||
SkMatrix transform = maskPaint.getShader()->getLocalMatrix();
|
||||
transform.postTranslate(SkFloatToScalar(aOffset.x), SkFloatToScalar(aOffset.y));
|
||||
SkShader* matrixShader = SkShader::CreateLocalMatrixShader(maskPaint.getShader(), transform);
|
||||
SkSafeUnref(maskPaint.setShader(matrixShader));
|
||||
SetPaintPattern(maskPaint,
|
||||
SurfacePattern(aMask, ExtendMode::CLAMP, Matrix::Translation(aOffset)),
|
||||
tmpBitmap);
|
||||
|
||||
SkLayerRasterizer::Builder builder;
|
||||
builder.addLayer(maskPaint);
|
||||
|
@ -1166,6 +1166,11 @@ SkiaGLGlue*
|
||||
gfxPlatform::GetSkiaGLGlue()
|
||||
{
|
||||
#ifdef USE_SKIA_GPU
|
||||
if (!gfxPlatform::GetPlatform()->UseAcceleratedSkiaCanvas()) {
|
||||
gfxCriticalNote << "Accelerated Skia canvas is disabled";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!mSkiaGlue) {
|
||||
/* Dummy context. We always draw into a FBO.
|
||||
*
|
||||
|
@ -545,7 +545,7 @@ AddAppDirToCommandLine(std::vector<std::string>& aCmdLine)
|
||||
nsString path;
|
||||
MOZ_ALWAYS_TRUE(NS_SUCCEEDED(appDir->GetPath(path)));
|
||||
aCmdLine.AppendLooseValue(UTF8ToWide("-appdir"));
|
||||
std::wstring wpath = path.get();
|
||||
std::wstring wpath(path.get());
|
||||
aCmdLine.AppendLooseValue(wpath);
|
||||
#else
|
||||
nsAutoCString path;
|
||||
|
@ -2936,7 +2936,7 @@ wasm::CompileFunction(CompileTask* task)
|
||||
MIRGraph graph(&results.alloc());
|
||||
CompileInfo compileInfo(func.numLocals());
|
||||
MIRGenerator mir(nullptr, options, &results.alloc(), &graph, &compileInfo,
|
||||
js_IonOptimizations.get(Optimization_AsmJS),
|
||||
IonOptimizations.get(Optimization_AsmJS),
|
||||
args.usesSignalHandlersForOOB);
|
||||
|
||||
// Build MIR graph
|
||||
|
@ -812,6 +812,7 @@ js::ExecuteRegExp(JSContext* cx, HandleObject regexp, HandleString string,
|
||||
return RegExpRunStatus_Error;
|
||||
} else if (reobj->needUpdateLastIndex()) {
|
||||
/* Steps 18.a-b. */
|
||||
MOZ_ASSERT(matches && !matches->empty());
|
||||
if (!SetLastIndex(cx, reobj, (*matches)[0].limit))
|
||||
return RegExpRunStatus_Error;
|
||||
}
|
||||
|
@ -1488,7 +1488,7 @@ EnableOsiPointRegisterChecks(JSContext*, unsigned argc, Value* vp)
|
||||
{
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
#ifdef CHECK_OSIPOINT_REGISTERS
|
||||
jit::js_JitOptions.checkOsiPointRegisters = true;
|
||||
jit::JitOptions.checkOsiPointRegisters = true;
|
||||
#endif
|
||||
args.rval().setUndefined();
|
||||
return true;
|
||||
@ -1782,7 +1782,7 @@ static bool
|
||||
SetIonCheckGraphCoherency(JSContext* cx, unsigned argc, Value* vp)
|
||||
{
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
jit::js_JitOptions.checkGraphConsistency = ToBoolean(args.get(0));
|
||||
jit::JitOptions.checkGraphConsistency = ToBoolean(args.get(0));
|
||||
args.rval().setUndefined();
|
||||
return true;
|
||||
}
|
||||
|
@ -306,7 +306,7 @@ BytecodeEmitter::emitN(JSOp op, size_t extra, ptrdiff_t* offset)
|
||||
* Don't updateDepth if op's use-count comes from the immediate
|
||||
* operand yet to be stored in the extra bytes after op.
|
||||
*/
|
||||
if (js_CodeSpec[op].nuses >= 0)
|
||||
if (CodeSpec[op].nuses >= 0)
|
||||
updateDepth(off);
|
||||
|
||||
if (offset)
|
||||
@ -520,7 +520,7 @@ BytecodeEmitter::emitLoopEntry(ParseNode* nextpn)
|
||||
void
|
||||
BytecodeEmitter::checkTypeSet(JSOp op)
|
||||
{
|
||||
if (js_CodeSpec[op].format & JOF_TYPESET) {
|
||||
if (CodeSpec[op].format & JOF_TYPESET) {
|
||||
if (typesetCount < UINT16_MAX)
|
||||
typesetCount++;
|
||||
}
|
||||
@ -997,7 +997,7 @@ BytecodeEmitter::emitIndex32(JSOp op, uint32_t index)
|
||||
MOZ_ASSERT(checkStrictOrSloppy(op));
|
||||
|
||||
const size_t len = 1 + UINT32_INDEX_LEN;
|
||||
MOZ_ASSERT(len == size_t(js_CodeSpec[op].length));
|
||||
MOZ_ASSERT(len == size_t(CodeSpec[op].length));
|
||||
|
||||
ptrdiff_t offset;
|
||||
if (!emitCheck(len, &offset))
|
||||
@ -1016,7 +1016,7 @@ BytecodeEmitter::emitIndexOp(JSOp op, uint32_t index)
|
||||
{
|
||||
MOZ_ASSERT(checkStrictOrSloppy(op));
|
||||
|
||||
const size_t len = js_CodeSpec[op].length;
|
||||
const size_t len = CodeSpec[op].length;
|
||||
MOZ_ASSERT(len >= 1 + UINT32_INDEX_LEN);
|
||||
|
||||
ptrdiff_t offset;
|
||||
@ -1141,7 +1141,7 @@ BytecodeEmitter::emitScopeCoordOp(JSOp op, ScopeCoordinate sc)
|
||||
MOZ_ASSERT(JOF_OPTYPE(op) == JOF_SCOPECOORD);
|
||||
|
||||
unsigned n = SCOPECOORD_HOPS_LEN + SCOPECOORD_SLOT_LEN;
|
||||
MOZ_ASSERT(int(n) + 1 /* op */ == js_CodeSpec[op].length);
|
||||
MOZ_ASSERT(int(n) + 1 /* op */ == CodeSpec[op].length);
|
||||
|
||||
ptrdiff_t off;
|
||||
if (!emitN(op, n, &off))
|
||||
@ -2742,7 +2742,7 @@ BytecodeEmitter::emitPropIncDec(ParseNode* pn)
|
||||
bool
|
||||
BytecodeEmitter::emitNameIncDec(ParseNode* pn)
|
||||
{
|
||||
const JSCodeSpec* cs = &js_CodeSpec[pn->pn_kid->getOp()];
|
||||
const JSCodeSpec* cs = &CodeSpec[pn->pn_kid->getOp()];
|
||||
|
||||
bool global = (cs->format & JOF_GNAME);
|
||||
bool post;
|
||||
|
@ -839,7 +839,7 @@ class FullParseHandler
|
||||
node->setOp(node->isOp(JSOP_GETLOCAL) ? JSOP_SETLOCAL : JSOP_SETNAME);
|
||||
}
|
||||
void maybeDespecializeSet(ParseNode* node) {
|
||||
if (!(js_CodeSpec[node->getOp()].format & JOF_SET))
|
||||
if (!(CodeSpec[node->getOp()].format & JOF_SET))
|
||||
node->setOp(JSOP_SETNAME);
|
||||
}
|
||||
|
||||
|
@ -615,7 +615,7 @@ ParseNode::appendOrCreateList(ParseNodeKind kind, JSOp op, ParseNode* left, Pars
|
||||
//
|
||||
if (left->isKind(kind) &&
|
||||
left->isOp(op) &&
|
||||
(js_CodeSpec[op].format & JOF_LEFTASSOC ||
|
||||
(CodeSpec[op].format & JOF_LEFTASSOC ||
|
||||
(kind == PNK_POW && !left->pn_parens)))
|
||||
{
|
||||
ListNode* list = &left->as<ListNode>();
|
||||
|
@ -1664,7 +1664,7 @@ ParseNode::test(unsigned flag) const
|
||||
inline void
|
||||
ParseNode::markAsAssigned()
|
||||
{
|
||||
MOZ_ASSERT(js_CodeSpec[pn_op].format & JOF_NAME);
|
||||
MOZ_ASSERT(CodeSpec[pn_op].format & JOF_NAME);
|
||||
if (isUsed())
|
||||
pn_lexdef->pn_dflags |= PND_ASSIGNED;
|
||||
pn_dflags |= PND_ASSIGNED;
|
||||
|
@ -263,7 +263,7 @@ ParseContext<FullParseHandler>::define(TokenStream& ts,
|
||||
switch (kind) {
|
||||
case Definition::ARG:
|
||||
MOZ_ASSERT(sc->isFunctionBox());
|
||||
dn->setOp((js_CodeSpec[dn->getOp()].format & JOF_SET) ? JSOP_SETARG : JSOP_GETARG);
|
||||
dn->setOp((CodeSpec[dn->getOp()].format & JOF_SET) ? JSOP_SETARG : JSOP_GETARG);
|
||||
dn->pn_blockid = bodyid;
|
||||
dn->pn_dflags |= PND_BOUND;
|
||||
if (!dn->pn_scopecoord.setSlot(ts, args_.length()))
|
||||
@ -294,7 +294,7 @@ ParseContext<FullParseHandler>::define(TokenStream& ts,
|
||||
// and non-deoptimized (e.g., inside a with scope) vars live in frame
|
||||
// or CallObject slots.
|
||||
if (!sc->isGlobalContext() && !dn->isDeoptimized()) {
|
||||
dn->setOp((js_CodeSpec[dn->getOp()].format & JOF_SET) ? JSOP_SETLOCAL : JSOP_GETLOCAL);
|
||||
dn->setOp((CodeSpec[dn->getOp()].format & JOF_SET) ? JSOP_SETLOCAL : JSOP_GETLOCAL);
|
||||
dn->pn_dflags |= PND_BOUND;
|
||||
if (!dn->pn_scopecoord.setSlot(ts, vars_.length() - 1))
|
||||
return false;
|
||||
@ -1452,7 +1452,7 @@ Parser<FullParseHandler>::makeDefIntoUse(Definition* dn, ParseNode* pn, HandleAt
|
||||
MOZ_ASSERT(dn->isKind(PNK_NAME));
|
||||
MOZ_ASSERT(dn->isArity(PN_NAME));
|
||||
MOZ_ASSERT(dn->pn_atom == atom);
|
||||
dn->setOp((js_CodeSpec[dn->getOp()].format & JOF_SET) ? JSOP_SETNAME : JSOP_GETNAME);
|
||||
dn->setOp((CodeSpec[dn->getOp()].format & JOF_SET) ? JSOP_SETNAME : JSOP_GETNAME);
|
||||
dn->setDefn(false);
|
||||
dn->setUsed(true);
|
||||
dn->pn_lexdef = (Definition*) pn;
|
||||
|
6
js/src/jit-test/tests/arguments/bug1227287.js
Normal file
6
js/src/jit-test/tests/arguments/bug1227287.js
Normal file
@ -0,0 +1,6 @@
|
||||
function f(y) {
|
||||
y = 1;
|
||||
assertEq(arguments.callee.arguments[0], 1);
|
||||
return () => y;
|
||||
}
|
||||
f(0);
|
17
js/src/jit-test/tests/ion/bug1225367.js
Normal file
17
js/src/jit-test/tests/ion/bug1225367.js
Normal file
@ -0,0 +1,17 @@
|
||||
function f() {
|
||||
var hits = 0;
|
||||
for (var T of [Float32Array, Float64Array, Float32Array]) {
|
||||
var arr = new T(1);
|
||||
try {
|
||||
arr[0] = Symbol.iterator;
|
||||
} catch(e) { hits++; }
|
||||
}
|
||||
for (var T of [Int32Array, Int16Array, Int8Array]) {
|
||||
var arr = new T(1);
|
||||
try {
|
||||
arr[0] = Symbol.iterator;
|
||||
} catch(e) { hits++; }
|
||||
}
|
||||
assertEq(hits, 6);
|
||||
}
|
||||
f();
|
@ -277,7 +277,7 @@ jit::CheckFrequentBailouts(JSContext* cx, JSScript* script, BailoutKind bailoutK
|
||||
// we compile this script LICM will be disabled.
|
||||
IonScript* ionScript = script->ionScript();
|
||||
|
||||
if (ionScript->numBailouts() >= js_JitOptions.frequentBailoutThreshold) {
|
||||
if (ionScript->numBailouts() >= JitOptions.frequentBailoutThreshold) {
|
||||
// If we bailout because of the first execution of a basic block,
|
||||
// then we should record which basic block we are returning in,
|
||||
// which should prevent this from happening again. Also note that
|
||||
|
@ -802,7 +802,7 @@ InitFromBailout(JSContext* cx, HandleScript caller, jsbytecode* callerPC,
|
||||
// FirstExecution bailouts, we invalidate and recompile the script with
|
||||
// IonMonkey. Failing to increment the counter of the current basic block
|
||||
// might lead to repeated bailouts and invalidations.
|
||||
if (!js_JitOptions.disablePgo && script->hasScriptCounts())
|
||||
if (!JitOptions.disablePgo && script->hasScriptCounts())
|
||||
script->incHitCount(pc);
|
||||
|
||||
JSOp op = JSOp(*pc);
|
||||
@ -989,7 +989,7 @@ InitFromBailout(JSContext* cx, HandleScript caller, jsbytecode* callerPC,
|
||||
|
||||
#ifdef JS_JITSPEW
|
||||
JitSpew(JitSpew_BaselineBailouts, " Resuming %s pc offset %d (op %s) (line %d) of %s:%" PRIuSIZE,
|
||||
resumeAfter ? "after" : "at", (int) pcOff, js_CodeName[op],
|
||||
resumeAfter ? "after" : "at", (int) pcOff, CodeName[op],
|
||||
PCToLineNumber(script, pc), script->filename(), script->lineno());
|
||||
JitSpew(JitSpew_BaselineBailouts, " Bailout kind: %s",
|
||||
BailoutKindString(bailoutKind));
|
||||
@ -1007,7 +1007,7 @@ InitFromBailout(JSContext* cx, HandleScript caller, jsbytecode* callerPC,
|
||||
// then the bailed out state should be in a position to enter
|
||||
// into the ICTypeMonitor chain for the op.
|
||||
bool enterMonitorChain = false;
|
||||
if (resumeAfter && (js_CodeSpec[op].format & JOF_TYPESET)) {
|
||||
if (resumeAfter && (CodeSpec[op].format & JOF_TYPESET)) {
|
||||
// Not every monitored op has a monitored fallback stub, e.g.
|
||||
// JSOP_NEWOBJECT, which always returns the same type for a
|
||||
// particular script/pc location.
|
||||
@ -1154,7 +1154,7 @@ InitFromBailout(JSContext* cx, HandleScript caller, jsbytecode* callerPC,
|
||||
JS_snprintf(buf, len, "%s %s %s on line %u of %s:%" PRIuSIZE,
|
||||
BailoutKindString(bailoutKind),
|
||||
resumeAfter ? "after" : "at",
|
||||
js_CodeName[op],
|
||||
CodeName[op],
|
||||
PCToLineNumber(script, pc),
|
||||
filename,
|
||||
script->lineno());
|
||||
|
@ -741,7 +741,7 @@ BaselineCompiler::emitWarmUpCounterIncrement(bool allowOsr)
|
||||
|
||||
Label skipCall;
|
||||
|
||||
const OptimizationInfo* info = js_IonOptimizations.get(js_IonOptimizations.firstLevel());
|
||||
const OptimizationInfo* info = IonOptimizations.get(IonOptimizations.firstLevel());
|
||||
uint32_t warmUpThreshold = info->compilerWarmUpThreshold(script, pc);
|
||||
masm.branch32(Assembler::LessThan, countReg, Imm32(warmUpThreshold), &skipCall);
|
||||
|
||||
@ -923,7 +923,7 @@ BaselineCompiler::emitBody()
|
||||
while (true) {
|
||||
JSOp op = JSOp(*pc);
|
||||
JitSpew(JitSpew_BaselineOp, "Compiling op @ %d: %s",
|
||||
int(script->pcToOffset(pc)), js_CodeName[op]);
|
||||
int(script->pcToOffset(pc)), CodeName[op]);
|
||||
|
||||
BytecodeInfo* info = analysis_.maybeInfo(pc);
|
||||
|
||||
@ -979,7 +979,7 @@ BaselineCompiler::emitBody()
|
||||
|
||||
switch (op) {
|
||||
default:
|
||||
JitSpew(JitSpew_BaselineAbort, "Unhandled op: %s", js_CodeName[op]);
|
||||
JitSpew(JitSpew_BaselineAbort, "Unhandled op: %s", CodeName[op]);
|
||||
return Method_CantCompile;
|
||||
|
||||
#define EMIT_OP(OP) \
|
||||
|
@ -321,7 +321,7 @@ SpewPatchBaselineFrame(uint8_t* oldReturnAddress, uint8_t* newReturnAddress,
|
||||
JitSpew(JitSpew_BaselineDebugModeOSR,
|
||||
"Patch return %p -> %p on BaselineJS frame (%s:%d) from %s at %s",
|
||||
oldReturnAddress, newReturnAddress, script->filename(), script->lineno(),
|
||||
ICEntryKindToString(frameKind), js_CodeName[(JSOp)*pc]);
|
||||
ICEntryKindToString(frameKind), CodeName[(JSOp)*pc]);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -331,7 +331,7 @@ SpewPatchBaselineFrameFromExceptionHandler(uint8_t* oldReturnAddress, uint8_t* n
|
||||
JitSpew(JitSpew_BaselineDebugModeOSR,
|
||||
"Patch return %p -> %p on BaselineJS frame (%s:%d) from exception handler at %s",
|
||||
oldReturnAddress, newReturnAddress, script->filename(), script->lineno(),
|
||||
js_CodeName[(JSOp)*pc]);
|
||||
CodeName[(JSOp)*pc]);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1749,7 +1749,7 @@ DoGetElemFallback(JSContext* cx, BaselineFrame* frame, ICGetElem_Fallback* stub_
|
||||
RootedScript script(cx, frame->script());
|
||||
jsbytecode* pc = stub->icEntry()->pc(frame->script());
|
||||
JSOp op = JSOp(*pc);
|
||||
FallbackICSpew(cx, stub, "GetElem(%s)", js_CodeName[op]);
|
||||
FallbackICSpew(cx, stub, "GetElem(%s)", CodeName[op]);
|
||||
|
||||
MOZ_ASSERT(op == JSOP_GETELEM || op == JSOP_CALLELEM);
|
||||
|
||||
@ -2727,7 +2727,7 @@ DoSetElemFallback(JSContext* cx, BaselineFrame* frame, ICSetElem_Fallback* stub_
|
||||
RootedScript script(cx, frame->script());
|
||||
jsbytecode* pc = stub->icEntry()->pc(script);
|
||||
JSOp op = JSOp(*pc);
|
||||
FallbackICSpew(cx, stub, "SetElem(%s)", js_CodeName[JSOp(*pc)]);
|
||||
FallbackICSpew(cx, stub, "SetElem(%s)", CodeName[JSOp(*pc)]);
|
||||
|
||||
MOZ_ASSERT(op == JSOP_SETELEM ||
|
||||
op == JSOP_STRICTSETELEM ||
|
||||
@ -4156,7 +4156,7 @@ DoGetNameFallback(JSContext* cx, BaselineFrame* frame, ICGetName_Fallback* stub_
|
||||
RootedScript script(cx, frame->script());
|
||||
jsbytecode* pc = stub->icEntry()->pc(script);
|
||||
mozilla::DebugOnly<JSOp> op = JSOp(*pc);
|
||||
FallbackICSpew(cx, stub, "GetName(%s)", js_CodeName[JSOp(*pc)]);
|
||||
FallbackICSpew(cx, stub, "GetName(%s)", CodeName[JSOp(*pc)]);
|
||||
|
||||
MOZ_ASSERT(op == JSOP_GETNAME || op == JSOP_GETGNAME);
|
||||
|
||||
@ -4315,7 +4315,7 @@ DoBindNameFallback(JSContext* cx, BaselineFrame* frame, ICBindName_Fallback* stu
|
||||
{
|
||||
jsbytecode* pc = stub->icEntry()->pc(frame->script());
|
||||
mozilla::DebugOnly<JSOp> op = JSOp(*pc);
|
||||
FallbackICSpew(cx, stub, "BindName(%s)", js_CodeName[JSOp(*pc)]);
|
||||
FallbackICSpew(cx, stub, "BindName(%s)", CodeName[JSOp(*pc)]);
|
||||
|
||||
MOZ_ASSERT(op == JSOP_BINDNAME || op == JSOP_BINDGNAME);
|
||||
|
||||
@ -4363,7 +4363,7 @@ DoGetIntrinsicFallback(JSContext* cx, BaselineFrame* frame, ICGetIntrinsic_Fallb
|
||||
RootedScript script(cx, frame->script());
|
||||
jsbytecode* pc = stub->icEntry()->pc(script);
|
||||
mozilla::DebugOnly<JSOp> op = JSOp(*pc);
|
||||
FallbackICSpew(cx, stub, "GetIntrinsic(%s)", js_CodeName[JSOp(*pc)]);
|
||||
FallbackICSpew(cx, stub, "GetIntrinsic(%s)", CodeName[JSOp(*pc)]);
|
||||
|
||||
MOZ_ASSERT(op == JSOP_GETINTRINSIC);
|
||||
|
||||
@ -4690,7 +4690,7 @@ DoSetPropFallback(JSContext* cx, BaselineFrame* frame, ICSetProp_Fallback* stub_
|
||||
RootedScript script(cx, frame->script());
|
||||
jsbytecode* pc = stub->icEntry()->pc(script);
|
||||
JSOp op = JSOp(*pc);
|
||||
FallbackICSpew(cx, stub, "SetProp(%s)", js_CodeName[op]);
|
||||
FallbackICSpew(cx, stub, "SetProp(%s)", CodeName[op]);
|
||||
|
||||
MOZ_ASSERT(op == JSOP_SETPROP ||
|
||||
op == JSOP_STRICTSETPROP ||
|
||||
@ -6083,7 +6083,7 @@ DoCallFallback(JSContext* cx, BaselineFrame* frame, ICCall_Fallback* stub_, uint
|
||||
RootedScript script(cx, frame->script());
|
||||
jsbytecode* pc = stub->icEntry()->pc(script);
|
||||
JSOp op = JSOp(*pc);
|
||||
FallbackICSpew(cx, stub, "Call(%s)", js_CodeName[op]);
|
||||
FallbackICSpew(cx, stub, "Call(%s)", CodeName[op]);
|
||||
|
||||
MOZ_ASSERT(argc == GET_ARGC(pc));
|
||||
bool constructing = (op == JSOP_NEW);
|
||||
@ -6189,7 +6189,7 @@ DoSpreadCallFallback(JSContext* cx, BaselineFrame* frame, ICCall_Fallback* stub_
|
||||
jsbytecode* pc = stub->icEntry()->pc(script);
|
||||
JSOp op = JSOp(*pc);
|
||||
bool constructing = (op == JSOP_SPREADNEW);
|
||||
FallbackICSpew(cx, stub, "SpreadCall(%s)", js_CodeName[op]);
|
||||
FallbackICSpew(cx, stub, "SpreadCall(%s)", CodeName[op]);
|
||||
|
||||
// Ensure vp array is rooted - we may GC in here.
|
||||
AutoArrayRooter vpRoot(cx, 3 + constructing, vp);
|
||||
|
@ -309,7 +309,7 @@ CanEnterBaselineJIT(JSContext* cx, HandleScript script, InterpreterFrame* osrFra
|
||||
return Method_Compiled;
|
||||
|
||||
// Check script warm-up counter.
|
||||
if (script->incWarmUpCounter() <= js_JitOptions.baselineWarmUpThreshold)
|
||||
if (script->incWarmUpCounter() <= JitOptions.baselineWarmUpThreshold)
|
||||
return Method_Skipped;
|
||||
|
||||
// Frames can be marked as debuggee frames independently of its underlying
|
||||
|
@ -68,7 +68,7 @@ BytecodeAnalysis::init(TempAllocator& alloc, GSNCache& gsn)
|
||||
unsigned offset = script_->pcToOffset(pc);
|
||||
|
||||
JitSpew(JitSpew_BaselineOp, "Analyzing op @ %d (end=%d): %s",
|
||||
int(script_->pcToOffset(pc)), int(script_->length()), js_CodeName[op]);
|
||||
int(script_->pcToOffset(pc)), int(script_->length()), CodeName[op]);
|
||||
|
||||
// If this bytecode info has not yet been initialized, it's not reachable.
|
||||
if (!infos_[offset].initialized)
|
||||
|
@ -3611,7 +3611,7 @@ CodeGenerator::visitApplyArrayGeneric(LApplyArrayGeneric* apply)
|
||||
|
||||
Address length(ToRegister(apply->getElements()), ObjectElements::offsetOfLength());
|
||||
masm.load32(length, tmp);
|
||||
bailoutCmp32(Assembler::Above, tmp, Imm32(js_JitOptions.maxStackArgs), snapshot);
|
||||
bailoutCmp32(Assembler::Above, tmp, Imm32(JitOptions.maxStackArgs), snapshot);
|
||||
|
||||
Address initializedLength(ToRegister(apply->getElements()),
|
||||
ObjectElements::offsetOfInitializedLength());
|
||||
|
@ -1516,7 +1516,7 @@ OptimizeMIR(MIRGenerator* mir)
|
||||
if (mir->shouldCancel("Start"))
|
||||
return false;
|
||||
|
||||
if (!js_JitOptions.disablePgo && !mir->compilingAsmJS()) {
|
||||
if (!JitOptions.disablePgo && !mir->compilingAsmJS()) {
|
||||
AutoTraceLog log(logger, TraceLogger_PruneUnusedBranches);
|
||||
if (!PruneUnusedBranches(mir, graph))
|
||||
return false;
|
||||
@ -2163,7 +2163,7 @@ IonCompile(JSContext* cx, JSScript* script,
|
||||
if (!constraints)
|
||||
return AbortReason_Alloc;
|
||||
|
||||
const OptimizationInfo* optimizationInfo = js_IonOptimizations.get(optimizationLevel);
|
||||
const OptimizationInfo* optimizationInfo = IonOptimizations.get(optimizationLevel);
|
||||
const JitCompileOptions options(cx);
|
||||
|
||||
IonBuilder* builder = alloc->new_<IonBuilder>((JSContext*) nullptr,
|
||||
@ -2333,7 +2333,7 @@ CheckScript(JSContext* cx, JSScript* script, bool osr)
|
||||
static MethodStatus
|
||||
CheckScriptSize(JSContext* cx, JSScript* script)
|
||||
{
|
||||
if (!js_JitOptions.limitScriptSize)
|
||||
if (!JitOptions.limitScriptSize)
|
||||
return Method_Compiled;
|
||||
|
||||
uint32_t numLocalsAndArgs = NumLocalsAndArgs(script);
|
||||
@ -2364,7 +2364,7 @@ CanIonCompileScript(JSContext* cx, JSScript* script, bool osr)
|
||||
static OptimizationLevel
|
||||
GetOptimizationLevel(HandleScript script, jsbytecode* pc)
|
||||
{
|
||||
return js_IonOptimizations.levelForScript(script, pc);
|
||||
return IonOptimizations.levelForScript(script, pc);
|
||||
}
|
||||
|
||||
static MethodStatus
|
||||
@ -2484,7 +2484,7 @@ jit::CanEnterAtBranch(JSContext* cx, HandleScript script, BaselineFrame* osrFram
|
||||
return Method_Skipped;
|
||||
|
||||
// Optionally ignore on user request.
|
||||
if (!js_JitOptions.osr)
|
||||
if (!JitOptions.osr)
|
||||
return Method_Skipped;
|
||||
|
||||
// Mark as forbidden if frame can't be handled.
|
||||
@ -2503,7 +2503,7 @@ jit::CanEnterAtBranch(JSContext* cx, HandleScript script, BaselineFrame* osrFram
|
||||
bool force = false;
|
||||
if (script->hasIonScript() && pc != script->ionScript()->osrPc()) {
|
||||
uint32_t count = script->ionScript()->incrOsrPcMismatchCounter();
|
||||
if (count <= js_JitOptions.osrPcMismatchesBeforeRecompile)
|
||||
if (count <= JitOptions.osrPcMismatchesBeforeRecompile)
|
||||
return Method_Skipped;
|
||||
force = true;
|
||||
}
|
||||
@ -2582,7 +2582,7 @@ jit::CanEnter(JSContext* cx, RunState& state)
|
||||
|
||||
// If --ion-eager is used, compile with Baseline first, so that we
|
||||
// can directly enter IonMonkey.
|
||||
if (js_JitOptions.eagerCompilation && !rscript->hasBaselineScript()) {
|
||||
if (JitOptions.eagerCompilation && !rscript->hasBaselineScript()) {
|
||||
MethodStatus status = CanEnterBaselineMethod(cx, state);
|
||||
if (status != Method_Compiled)
|
||||
return status;
|
||||
@ -2848,7 +2848,7 @@ InvalidateActivation(FreeOp* fop, const JitActivationIterator& activations, bool
|
||||
JitSpew(JitSpew_IonInvalidate, "BEGIN invalidating activation");
|
||||
|
||||
#ifdef CHECK_OSIPOINT_REGISTERS
|
||||
if (js_JitOptions.checkOsiPointRegisters)
|
||||
if (JitOptions.checkOsiPointRegisters)
|
||||
activations->asJit()->setCheckRegs(false);
|
||||
#endif
|
||||
|
||||
|
@ -175,7 +175,7 @@ IsIonInlinablePC(jsbytecode* pc) {
|
||||
inline bool
|
||||
TooManyActualArguments(unsigned nargs)
|
||||
{
|
||||
return nargs > js_JitOptions.maxStackArgs;
|
||||
return nargs > JitOptions.maxStackArgs;
|
||||
}
|
||||
|
||||
inline bool
|
||||
|
@ -2443,7 +2443,7 @@ void
|
||||
jit::AssertGraphCoherency(MIRGraph& graph)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
if (!js_JitOptions.checkGraphConsistency)
|
||||
if (!JitOptions.checkGraphConsistency)
|
||||
return;
|
||||
AssertBasicGraphCoherency(graph);
|
||||
AssertReversePostorder(graph);
|
||||
@ -2530,7 +2530,7 @@ jit::AssertExtendedGraphCoherency(MIRGraph& graph)
|
||||
// are split)
|
||||
|
||||
#ifdef DEBUG
|
||||
if (!js_JitOptions.checkGraphConsistency)
|
||||
if (!JitOptions.checkGraphConsistency)
|
||||
return;
|
||||
|
||||
AssertGraphCoherency(graph);
|
||||
@ -3683,7 +3683,7 @@ jit::AnalyzeNewScriptDefiniteProperties(JSContext* cx, JSFunction* fun,
|
||||
script->needsArgsObj(),
|
||||
inlineScriptTree);
|
||||
|
||||
const OptimizationInfo* optimizationInfo = js_IonOptimizations.get(Optimization_Normal);
|
||||
const OptimizationInfo* optimizationInfo = IonOptimizations.get(Optimization_Normal);
|
||||
|
||||
CompilerConstraintList* constraints = NewCompilerConstraintList(temp);
|
||||
if (!constraints) {
|
||||
@ -3904,7 +3904,7 @@ jit::AnalyzeArgumentsUsage(JSContext* cx, JSScript* scriptArg)
|
||||
/* needsArgsObj = */ true,
|
||||
inlineScriptTree);
|
||||
|
||||
const OptimizationInfo* optimizationInfo = js_IonOptimizations.get(Optimization_Normal);
|
||||
const OptimizationInfo* optimizationInfo = IonOptimizations.get(Optimization_Normal);
|
||||
|
||||
CompilerConstraintList* constraints = NewCompilerConstraintList(temp);
|
||||
if (!constraints) {
|
||||
|
@ -242,7 +242,7 @@ IonBuilder::spew(const char* message)
|
||||
static inline int32_t
|
||||
GetJumpOffset(jsbytecode* pc)
|
||||
{
|
||||
MOZ_ASSERT(js_CodeSpec[JSOp(*pc)].type() == JOF_JUMP);
|
||||
MOZ_ASSERT(CodeSpec[JSOp(*pc)].type() == JOF_JUMP);
|
||||
return GET_JUMP_OFFSET(pc);
|
||||
}
|
||||
|
||||
@ -639,7 +639,7 @@ IonBuilder::analyzeNewLoopTypes(MBasicBlock* entry, jsbytecode* start, jsbytecod
|
||||
if (*last == JSOP_POS)
|
||||
last = earlier;
|
||||
|
||||
if (js_CodeSpec[*last].format & JOF_TYPESET) {
|
||||
if (CodeSpec[*last].format & JOF_TYPESET) {
|
||||
TemporaryTypeSet* typeSet = bytecodeTypes(last);
|
||||
if (!typeSet->empty()) {
|
||||
MIRType type = typeSet->getKnownMIRType();
|
||||
@ -1565,7 +1565,7 @@ IonBuilder::traverseBytecode()
|
||||
}
|
||||
#endif
|
||||
|
||||
pc += js_CodeSpec[op].length;
|
||||
pc += CodeSpec[op].length;
|
||||
current->updateTrackedSite(bytecodeSite(pc));
|
||||
}
|
||||
|
||||
@ -1993,6 +1993,9 @@ IonBuilder::inspectOpcode(JSOp op)
|
||||
case JSOP_FUNCTIONTHIS:
|
||||
return jsop_functionthis();
|
||||
|
||||
case JSOP_GLOBALTHIS:
|
||||
return jsop_globalthis();
|
||||
|
||||
case JSOP_CALLEE: {
|
||||
MDefinition* callee = getCallee();
|
||||
current->push(callee);
|
||||
@ -2111,7 +2114,7 @@ IonBuilder::inspectOpcode(JSOp op)
|
||||
// thing anyways.
|
||||
trackActionableAbort("Unsupported bytecode");
|
||||
#ifdef DEBUG
|
||||
return abort("Unsupported opcode: %s", js_CodeName[op]);
|
||||
return abort("Unsupported opcode: %s", CodeName[op]);
|
||||
#else
|
||||
return abort("Unsupported opcode: %d", op);
|
||||
#endif
|
||||
@ -2436,7 +2439,7 @@ IonBuilder::restartLoop(CFGState state)
|
||||
{
|
||||
spew("New types at loop header, restarting loop body");
|
||||
|
||||
if (js_JitOptions.limitScriptSize) {
|
||||
if (JitOptions.limitScriptSize) {
|
||||
if (++numLoopRestarts_ >= MAX_LOOP_RESTARTS)
|
||||
return ControlStatus_Abort;
|
||||
}
|
||||
@ -2922,7 +2925,7 @@ IonBuilder::processBreak(JSOp op, jssrcnote* sn)
|
||||
MOZ_ASSERT(found);
|
||||
|
||||
setCurrent(nullptr);
|
||||
pc += js_CodeSpec[op].length;
|
||||
pc += CodeSpec[op].length;
|
||||
return processControlEnd();
|
||||
}
|
||||
|
||||
@ -2959,7 +2962,7 @@ IonBuilder::processContinue(JSOp op)
|
||||
state.loop.continues = new(alloc()) DeferredEdge(current, state.loop.continues);
|
||||
|
||||
setCurrent(nullptr);
|
||||
pc += js_CodeSpec[op].length;
|
||||
pc += CodeSpec[op].length;
|
||||
return processControlEnd();
|
||||
}
|
||||
|
||||
@ -2998,7 +3001,7 @@ IonBuilder::processSwitchBreak(JSOp op)
|
||||
*breaks = new(alloc()) DeferredEdge(current, *breaks);
|
||||
|
||||
setCurrent(nullptr);
|
||||
pc += js_CodeSpec[op].length;
|
||||
pc += CodeSpec[op].length;
|
||||
return processControlEnd();
|
||||
}
|
||||
|
||||
@ -4246,7 +4249,7 @@ IonBuilder::jsop_andor(JSOp op)
|
||||
{
|
||||
MOZ_ASSERT(op == JSOP_AND || op == JSOP_OR);
|
||||
|
||||
jsbytecode* rhsStart = pc + js_CodeSpec[op].length;
|
||||
jsbytecode* rhsStart = pc + CodeSpec[op].length;
|
||||
jsbytecode* joinStart = pc + GetJumpOffset(pc);
|
||||
MOZ_ASSERT(joinStart > pc);
|
||||
|
||||
@ -4308,7 +4311,7 @@ bool
|
||||
IonBuilder::jsop_ifeq(JSOp op)
|
||||
{
|
||||
// IFEQ always has a forward offset.
|
||||
jsbytecode* trueStart = pc + js_CodeSpec[op].length;
|
||||
jsbytecode* trueStart = pc + CodeSpec[op].length;
|
||||
jsbytecode* falseStart = pc + GetJumpOffset(pc);
|
||||
MOZ_ASSERT(falseStart > pc);
|
||||
|
||||
@ -4785,7 +4788,7 @@ IonBuilder::arithTrySharedStub(bool* emitted, JSOp op,
|
||||
|
||||
// Try to emit a shared stub cache.
|
||||
|
||||
if (js_JitOptions.disableSharedStubs)
|
||||
if (JitOptions.disableSharedStubs)
|
||||
return true;
|
||||
|
||||
// The actual jsop 'jsop_pos' is not supported yet.
|
||||
@ -5266,7 +5269,7 @@ IonBuilder::makeInliningDecision(JSObject* targetArg, CallInfo& callInfo)
|
||||
// Cap the inlining depth.
|
||||
|
||||
uint32_t maxInlineDepth;
|
||||
if (js_JitOptions.isSmallFunction(targetScript)) {
|
||||
if (JitOptions.isSmallFunction(targetScript)) {
|
||||
maxInlineDepth = optimizationInfo().smallFunctionMaxInlineDepth();
|
||||
} else {
|
||||
maxInlineDepth = optimizationInfo().maxInlineDepth();
|
||||
@ -7017,7 +7020,7 @@ IonBuilder::compareTrySharedStub(bool* emitted, JSOp op, MDefinition* left, MDef
|
||||
|
||||
// Try to emit a shared stub cache.
|
||||
|
||||
if (js_JitOptions.disableSharedStubs)
|
||||
if (JitOptions.disableSharedStubs)
|
||||
return true;
|
||||
|
||||
if (JSOp(*pc) == JSOP_CASE)
|
||||
@ -7733,7 +7736,7 @@ IonBuilder::insertRecompileCheck()
|
||||
{
|
||||
// No need for recompile checks if this is the highest optimization level.
|
||||
OptimizationLevel curLevel = optimizationInfo().level();
|
||||
if (js_IonOptimizations.isLastLevel(curLevel))
|
||||
if (IonOptimizations.isLastLevel(curLevel))
|
||||
return;
|
||||
|
||||
// Add recompile check.
|
||||
@ -7744,8 +7747,8 @@ IonBuilder::insertRecompileCheck()
|
||||
|
||||
// Add recompile check to recompile when the warm-up count reaches the
|
||||
// threshold of the next optimization level.
|
||||
OptimizationLevel nextLevel = js_IonOptimizations.nextLevel(curLevel);
|
||||
const OptimizationInfo* info = js_IonOptimizations.get(nextLevel);
|
||||
OptimizationLevel nextLevel = IonOptimizations.nextLevel(curLevel);
|
||||
const OptimizationInfo* info = IonOptimizations.get(nextLevel);
|
||||
uint32_t warmUpThreshold = info->compilerWarmUpThreshold(topBuilder->script());
|
||||
MRecompileCheck* check = MRecompileCheck::New(alloc(), topBuilder->script(), warmUpThreshold,
|
||||
MRecompileCheck::RecompileCheck_OptimizationLevel);
|
||||
@ -11907,7 +11910,7 @@ IonBuilder::getPropTrySharedStub(bool* emitted, MDefinition* obj)
|
||||
|
||||
// Try to emit a shared stub cache.
|
||||
|
||||
if (js_JitOptions.disableSharedStubs)
|
||||
if (JitOptions.disableSharedStubs)
|
||||
return true;
|
||||
|
||||
MInstruction* stub = MUnarySharedStub::New(alloc(), obj);
|
||||
@ -12920,6 +12923,20 @@ IonBuilder::jsop_functionthis()
|
||||
return resumeAfter(thisObj);
|
||||
}
|
||||
|
||||
bool
|
||||
IonBuilder::jsop_globalthis()
|
||||
{
|
||||
if (script()->hasNonSyntacticScope()) {
|
||||
// Ion does not compile global scripts with a non-syntactic scope, but
|
||||
// we can end up here when we're compiling an arrow function.
|
||||
return abort("JSOP_GLOBALTHIS in script with non-syntactic scope");
|
||||
}
|
||||
|
||||
ClonedBlockObject* globalLexical = &script()->global().lexicalScope();
|
||||
pushConstant(globalLexical->thisValue());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
IonBuilder::jsop_typeof()
|
||||
{
|
||||
|
@ -720,6 +720,7 @@ class IonBuilder
|
||||
bool jsop_lambda(JSFunction* fun);
|
||||
bool jsop_lambda_arrow(JSFunction* fun);
|
||||
bool jsop_functionthis();
|
||||
bool jsop_globalthis();
|
||||
bool jsop_typeof();
|
||||
bool jsop_toid();
|
||||
bool jsop_iter(uint8_t flags);
|
||||
@ -1263,7 +1264,7 @@ class IonBuilder
|
||||
}
|
||||
|
||||
bool forceInlineCaches() {
|
||||
return MOZ_UNLIKELY(js_JitOptions.forceInlineCaches);
|
||||
return MOZ_UNLIKELY(JitOptions.forceInlineCaches);
|
||||
}
|
||||
|
||||
// Out-of-line variants that don't check if optimization tracking is
|
||||
|
@ -4229,9 +4229,9 @@ IsDenseElementSetInlineable(JSObject* obj, const Value& idval, ConstantOrRegiste
|
||||
static bool
|
||||
IsTypedArrayElementSetInlineable(JSObject* obj, const Value& idval, const Value& value)
|
||||
{
|
||||
// Don't bother attaching stubs for assigning strings and objects.
|
||||
// Don't bother attaching stubs for assigning strings, objects or symbols.
|
||||
return IsAnyTypedArray(obj) && idval.isInt32() &&
|
||||
!value.isString() && !value.isObject();
|
||||
!value.isString() && !value.isObject() && !value.isSymbol();
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -16,7 +16,7 @@ using namespace js::jit;
|
||||
namespace js {
|
||||
namespace jit {
|
||||
|
||||
OptimizationInfos js_IonOptimizations;
|
||||
OptimizationInfos IonOptimizations;
|
||||
|
||||
void
|
||||
OptimizationInfo::initNormalOptimizationInfo()
|
||||
@ -82,8 +82,8 @@ OptimizationInfo::compilerWarmUpThreshold(JSScript* script, jsbytecode* pc) cons
|
||||
pc = nullptr;
|
||||
|
||||
uint32_t warmUpThreshold = compilerWarmUpThreshold_;
|
||||
if (js_JitOptions.forcedDefaultIonWarmUpThreshold.isSome())
|
||||
warmUpThreshold = js_JitOptions.forcedDefaultIonWarmUpThreshold.ref();
|
||||
if (JitOptions.forcedDefaultIonWarmUpThreshold.isSome())
|
||||
warmUpThreshold = JitOptions.forcedDefaultIonWarmUpThreshold.ref();
|
||||
|
||||
// If the script is too large to compile on the main thread, we can still
|
||||
// compile it off thread. In these cases, increase the warm-up counter
|
||||
@ -97,7 +97,7 @@ OptimizationInfo::compilerWarmUpThreshold(JSScript* script, jsbytecode* pc) cons
|
||||
if (numLocalsAndArgs > MAX_MAIN_THREAD_LOCALS_AND_ARGS)
|
||||
warmUpThreshold *= (numLocalsAndArgs / (double) MAX_MAIN_THREAD_LOCALS_AND_ARGS);
|
||||
|
||||
if (!pc || js_JitOptions.eagerCompilation)
|
||||
if (!pc || JitOptions.eagerCompilation)
|
||||
return warmUpThreshold;
|
||||
|
||||
// It's more efficient to enter outer loops, rather than inner loops, via OSR.
|
||||
|
@ -152,37 +152,37 @@ class OptimizationInfo
|
||||
}
|
||||
|
||||
bool inlineInterpreted() const {
|
||||
return inlineInterpreted_ && !js_JitOptions.disableInlining;
|
||||
return inlineInterpreted_ && !JitOptions.disableInlining;
|
||||
}
|
||||
|
||||
bool inlineNative() const {
|
||||
return inlineNative_ && !js_JitOptions.disableInlining;
|
||||
return inlineNative_ && !JitOptions.disableInlining;
|
||||
}
|
||||
|
||||
uint32_t compilerWarmUpThreshold(JSScript* script, jsbytecode* pc = nullptr) const;
|
||||
|
||||
bool eagerSimdUnboxEnabled() const {
|
||||
return eagerSimdUnbox_ && !js_JitOptions.disableEagerSimdUnbox;
|
||||
return eagerSimdUnbox_ && !JitOptions.disableEagerSimdUnbox;
|
||||
}
|
||||
|
||||
bool gvnEnabled() const {
|
||||
return gvn_ && !js_JitOptions.disableGvn;
|
||||
return gvn_ && !JitOptions.disableGvn;
|
||||
}
|
||||
|
||||
bool licmEnabled() const {
|
||||
return licm_ && !js_JitOptions.disableLicm;
|
||||
return licm_ && !JitOptions.disableLicm;
|
||||
}
|
||||
|
||||
bool rangeAnalysisEnabled() const {
|
||||
return rangeAnalysis_ && !js_JitOptions.disableRangeAnalysis;
|
||||
return rangeAnalysis_ && !JitOptions.disableRangeAnalysis;
|
||||
}
|
||||
|
||||
bool loopUnrollingEnabled() const {
|
||||
return loopUnrolling_ && !js_JitOptions.disableLoopUnrolling;
|
||||
return loopUnrolling_ && !JitOptions.disableLoopUnrolling;
|
||||
}
|
||||
|
||||
bool instructionReorderingEnabled() const {
|
||||
return reordering_ && !js_JitOptions.disableInstructionReordering;
|
||||
return reordering_ && !JitOptions.disableInstructionReordering;
|
||||
}
|
||||
|
||||
bool autoTruncateEnabled() const {
|
||||
@ -190,23 +190,23 @@ class OptimizationInfo
|
||||
}
|
||||
|
||||
bool sincosEnabled() const {
|
||||
return sincos_ && !js_JitOptions.disableSincos;
|
||||
return sincos_ && !JitOptions.disableSincos;
|
||||
}
|
||||
|
||||
bool sinkEnabled() const {
|
||||
return sink_ && !js_JitOptions.disableSink;
|
||||
return sink_ && !JitOptions.disableSink;
|
||||
}
|
||||
|
||||
bool eaaEnabled() const {
|
||||
return eaa_ && !js_JitOptions.disableEaa;
|
||||
return eaa_ && !JitOptions.disableEaa;
|
||||
}
|
||||
|
||||
bool amaEnabled() const {
|
||||
return ama_ && !js_JitOptions.disableAma;
|
||||
return ama_ && !JitOptions.disableAma;
|
||||
}
|
||||
|
||||
bool edgeCaseAnalysisEnabled() const {
|
||||
return edgeCaseAnalysis_ && !js_JitOptions.disableEdgeCaseAnalysis;
|
||||
return edgeCaseAnalysis_ && !JitOptions.disableEdgeCaseAnalysis;
|
||||
}
|
||||
|
||||
bool eliminateRedundantChecksEnabled() const {
|
||||
@ -214,13 +214,13 @@ class OptimizationInfo
|
||||
}
|
||||
|
||||
IonRegisterAllocator registerAllocator() const {
|
||||
if (js_JitOptions.forcedRegisterAllocator.isSome())
|
||||
return js_JitOptions.forcedRegisterAllocator.ref();
|
||||
if (JitOptions.forcedRegisterAllocator.isSome())
|
||||
return JitOptions.forcedRegisterAllocator.ref();
|
||||
return registerAllocator_;
|
||||
}
|
||||
|
||||
bool scalarReplacementEnabled() const {
|
||||
return scalarReplacement_ && !js_JitOptions.disableScalarReplacement;
|
||||
return scalarReplacement_ && !JitOptions.disableScalarReplacement;
|
||||
}
|
||||
|
||||
uint32_t smallFunctionMaxInlineDepth() const {
|
||||
@ -234,7 +234,7 @@ class OptimizationInfo
|
||||
}
|
||||
|
||||
uint32_t inlineMaxBytecodePerCallSite(bool offThread) const {
|
||||
return (offThread || !js_JitOptions.limitScriptSize)
|
||||
return (offThread || !JitOptions.limitScriptSize)
|
||||
? inlineMaxBytecodePerCallSiteOffThread_
|
||||
: inlineMaxBytecodePerCallSiteMainThread_;
|
||||
}
|
||||
@ -253,8 +253,8 @@ class OptimizationInfo
|
||||
|
||||
uint32_t inliningWarmUpThreshold() const {
|
||||
uint32_t compilerWarmUpThreshold = compilerWarmUpThreshold_;
|
||||
if (js_JitOptions.forcedDefaultIonWarmUpThreshold.isSome())
|
||||
compilerWarmUpThreshold = js_JitOptions.forcedDefaultIonWarmUpThreshold.ref();
|
||||
if (JitOptions.forcedDefaultIonWarmUpThreshold.isSome())
|
||||
compilerWarmUpThreshold = JitOptions.forcedDefaultIonWarmUpThreshold.ref();
|
||||
return compilerWarmUpThreshold * inliningWarmUpThresholdFactor_;
|
||||
}
|
||||
|
||||
@ -284,7 +284,7 @@ class OptimizationInfos
|
||||
OptimizationLevel levelForScript(JSScript* script, jsbytecode* pc = nullptr) const;
|
||||
};
|
||||
|
||||
extern OptimizationInfos js_IonOptimizations;
|
||||
extern OptimizationInfos IonOptimizations;
|
||||
|
||||
} // namespace jit
|
||||
} // namespace js
|
||||
|
@ -827,7 +827,7 @@ HandleException(ResumeFromException* rfe)
|
||||
JitActivation* activation = cx->runtime()->activation()->asJit();
|
||||
|
||||
#ifdef CHECK_OSIPOINT_REGISTERS
|
||||
if (js_JitOptions.checkOsiPointRegisters)
|
||||
if (JitOptions.checkOsiPointRegisters)
|
||||
activation->setCheckRegs(false);
|
||||
#endif
|
||||
|
||||
@ -1530,7 +1530,7 @@ MarkJitActivation(JSTracer* trc, const JitActivationIterator& activations)
|
||||
JitActivation* activation = activations->asJit();
|
||||
|
||||
#ifdef CHECK_OSIPOINT_REGISTERS
|
||||
if (js_JitOptions.checkOsiPointRegisters) {
|
||||
if (JitOptions.checkOsiPointRegisters) {
|
||||
// GC can modify spilled registers, breaking our register checks.
|
||||
// To handle this, we disable these checks for the current VM call
|
||||
// when a GC happens.
|
||||
@ -2704,7 +2704,7 @@ JitFrameIterator::dumpBaseline() const
|
||||
baselineScriptAndPc(script.address(), &pc);
|
||||
|
||||
fprintf(stderr, " script = %p, pc = %p (offset %u)\n", (void*)script, pc, uint32_t(script->pcToOffset(pc)));
|
||||
fprintf(stderr, " current op: %s\n", js_CodeName[*pc]);
|
||||
fprintf(stderr, " current op: %s\n", CodeName[*pc]);
|
||||
|
||||
fprintf(stderr, " actual args: %d\n", numActualArgs());
|
||||
|
||||
@ -2748,7 +2748,7 @@ InlineFrameIterator::dump() const
|
||||
script()->filename(), script()->lineno());
|
||||
|
||||
fprintf(stderr, " script = %p, pc = %p\n", (void*) script(), pc());
|
||||
fprintf(stderr, " current op: %s\n", js_CodeName[*pc()]);
|
||||
fprintf(stderr, " current op: %s\n", CodeName[*pc()]);
|
||||
|
||||
if (!more()) {
|
||||
numActualArgs();
|
||||
|
@ -17,7 +17,7 @@ using mozilla::Maybe;
|
||||
namespace js {
|
||||
namespace jit {
|
||||
|
||||
JitOptions js_JitOptions;
|
||||
DefaultJitOptions JitOptions;
|
||||
|
||||
static void Warn(const char* env, const char* value)
|
||||
{
|
||||
@ -57,7 +57,7 @@ T overrideDefault(const char* param, T dflt) {
|
||||
return dflt;
|
||||
}
|
||||
#define SET_DEFAULT(var, dflt) var = overrideDefault("JIT_OPTION_" #var, dflt)
|
||||
JitOptions::JitOptions()
|
||||
DefaultJitOptions::DefaultJitOptions()
|
||||
{
|
||||
// Whether to perform expensive graph-consistency DEBUG-only assertions.
|
||||
// It can be useful to disable this to reduce DEBUG-compile time of large
|
||||
@ -187,19 +187,19 @@ JitOptions::JitOptions()
|
||||
}
|
||||
|
||||
bool
|
||||
JitOptions::isSmallFunction(JSScript* script) const
|
||||
DefaultJitOptions::isSmallFunction(JSScript* script) const
|
||||
{
|
||||
return script->length() <= smallFunctionMaxBytecodeLength_;
|
||||
}
|
||||
|
||||
void
|
||||
JitOptions::enableGvn(bool enable)
|
||||
DefaultJitOptions::enableGvn(bool enable)
|
||||
{
|
||||
disableGvn = !enable;
|
||||
}
|
||||
|
||||
void
|
||||
JitOptions::setEagerCompilation()
|
||||
DefaultJitOptions::setEagerCompilation()
|
||||
{
|
||||
eagerCompilation = true;
|
||||
baselineWarmUpThreshold = 0;
|
||||
@ -208,27 +208,27 @@ JitOptions::setEagerCompilation()
|
||||
}
|
||||
|
||||
void
|
||||
JitOptions::setCompilerWarmUpThreshold(uint32_t warmUpThreshold)
|
||||
DefaultJitOptions::setCompilerWarmUpThreshold(uint32_t warmUpThreshold)
|
||||
{
|
||||
forcedDefaultIonWarmUpThreshold.reset();
|
||||
forcedDefaultIonWarmUpThreshold.emplace(warmUpThreshold);
|
||||
|
||||
// Undo eager compilation
|
||||
if (eagerCompilation && warmUpThreshold != 0) {
|
||||
jit::JitOptions defaultValues;
|
||||
jit::DefaultJitOptions defaultValues;
|
||||
eagerCompilation = false;
|
||||
baselineWarmUpThreshold = defaultValues.baselineWarmUpThreshold;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
JitOptions::resetCompilerWarmUpThreshold()
|
||||
DefaultJitOptions::resetCompilerWarmUpThreshold()
|
||||
{
|
||||
forcedDefaultIonWarmUpThreshold.reset();
|
||||
|
||||
// Undo eager compilation
|
||||
if (eagerCompilation) {
|
||||
jit::JitOptions defaultValues;
|
||||
jit::DefaultJitOptions defaultValues;
|
||||
eagerCompilation = false;
|
||||
baselineWarmUpThreshold = defaultValues.baselineWarmUpThreshold;
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ LookupRegisterAllocator(const char* name)
|
||||
return mozilla::Nothing();
|
||||
}
|
||||
|
||||
struct JitOptions
|
||||
struct DefaultJitOptions
|
||||
{
|
||||
bool checkGraphConsistency;
|
||||
#ifdef CHECK_OSIPOINT_REGISTERS
|
||||
@ -78,7 +78,7 @@ struct JitOptions
|
||||
// The options below affect the rest of the VM, and not just the JIT.
|
||||
bool disableUnboxedObjects;
|
||||
|
||||
JitOptions();
|
||||
DefaultJitOptions();
|
||||
bool isSmallFunction(JSScript* script) const;
|
||||
void setEagerCompilation();
|
||||
void setCompilerWarmUpThreshold(uint32_t warmUpThreshold);
|
||||
@ -86,7 +86,7 @@ struct JitOptions
|
||||
void enableGvn(bool val);
|
||||
};
|
||||
|
||||
extern JitOptions js_JitOptions;
|
||||
extern DefaultJitOptions JitOptions;
|
||||
|
||||
} // namespace jit
|
||||
} // namespace js
|
||||
|
@ -1392,7 +1392,7 @@ JitcodeRegionEntry::WriteRun(CompactBufferWriter& writer,
|
||||
jsbytecode* pc = entry[i].tree->script()->offsetToPC(curBc);
|
||||
#ifdef JS_JITSPEW
|
||||
JSOp op = JSOp(*pc);
|
||||
JitSpewCont(JitSpew_Profiling, "%s ", js_CodeName[op]);
|
||||
JitSpewCont(JitSpew_Profiling, "%s ", CodeName[op]);
|
||||
#endif
|
||||
curBc += GetBytecodeLength(pc);
|
||||
}
|
||||
|
@ -586,7 +586,7 @@ LIRGenerator::visitAssertFloat32(MAssertFloat32* assertion)
|
||||
MIRType type = assertion->input()->type();
|
||||
DebugOnly<bool> checkIsFloat32 = assertion->mustBeFloat32();
|
||||
|
||||
if (type != MIRType_Value && !js_JitOptions.eagerCompilation) {
|
||||
if (type != MIRType_Value && !JitOptions.eagerCompilation) {
|
||||
MOZ_ASSERT_IF(checkIsFloat32, type == MIRType_Float32);
|
||||
MOZ_ASSERT_IF(!checkIsFloat32, type != MIRType_Float32);
|
||||
}
|
||||
|
@ -2580,7 +2580,7 @@ IonBuilder::inlineAssertRecoveredOnBailout(CallInfo& callInfo)
|
||||
if (callInfo.argc() != 2)
|
||||
return InliningStatus_NotInlined;
|
||||
|
||||
if (js_JitOptions.checkRangeAnalysis) {
|
||||
if (JitOptions.checkRangeAnalysis) {
|
||||
// If we are checking the range of all instructions, then the guards
|
||||
// inserted by Range Analysis prevent the use of recover
|
||||
// instruction. Thus, we just disable these checks.
|
||||
|
@ -1090,7 +1090,7 @@ void
|
||||
MCompare::printOpcode(GenericPrinter& out) const
|
||||
{
|
||||
MDefinition::printOpcode(out);
|
||||
out.printf(" %s", js_CodeName[jsop()]);
|
||||
out.printf(" %s", CodeName[jsop()]);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1721,7 +1721,7 @@ MacroAssembler::convertValueToFloatingPoint(JSContext* cx, const Value& v, Float
|
||||
return true;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(v.isObject());
|
||||
MOZ_ASSERT(v.isObject() || v.isSymbol());
|
||||
jump(fail);
|
||||
return true;
|
||||
}
|
||||
@ -1944,7 +1944,7 @@ MacroAssembler::convertValueToInt(JSContext* cx, const Value& v, Register output
|
||||
return true;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(v.isObject());
|
||||
MOZ_ASSERT(v.isObject() || v.isSymbol());
|
||||
|
||||
jump(fail);
|
||||
return true;
|
||||
|
@ -1756,9 +1756,9 @@ MArgumentsLength::computeRange(TempAllocator& alloc)
|
||||
{
|
||||
// This is is a conservative upper bound on what |TooManyActualArguments|
|
||||
// checks. If exceeded, Ion will not be entered in the first place.
|
||||
MOZ_ASSERT(js_JitOptions.maxStackArgs <= UINT32_MAX,
|
||||
MOZ_ASSERT(JitOptions.maxStackArgs <= UINT32_MAX,
|
||||
"NewUInt32Range requires a uint32 value");
|
||||
setRange(Range::NewUInt32Range(alloc, 0, js_JitOptions.maxStackArgs));
|
||||
setRange(Range::NewUInt32Range(alloc, 0, JitOptions.maxStackArgs));
|
||||
}
|
||||
|
||||
void
|
||||
@ -2258,7 +2258,7 @@ RangeAnalysis::analyze()
|
||||
bool
|
||||
RangeAnalysis::addRangeAssertions()
|
||||
{
|
||||
if (!js_JitOptions.checkRangeAnalysis)
|
||||
if (!JitOptions.checkRangeAnalysis)
|
||||
return true;
|
||||
|
||||
// Check the computed range for this instruction, if the option is set. Note
|
||||
|
@ -928,7 +928,7 @@ DoBinaryArithFallback(JSContext* cx, BaselineFrame* frame, ICBinaryArith_Fallbac
|
||||
|
||||
jsbytecode* pc = stub->icEntry()->pc(script);
|
||||
JSOp op = JSOp(*pc);
|
||||
FallbackICSpew(cx, stub, "BinaryArith(%s,%d,%d)", js_CodeName[op],
|
||||
FallbackICSpew(cx, stub, "BinaryArith(%s,%d,%d)", CodeName[op],
|
||||
int(lhs.isDouble() ? JSVAL_TYPE_DOUBLE : lhs.extractNonDoubleType()),
|
||||
int(rhs.isDouble() ? JSVAL_TYPE_DOUBLE : rhs.extractNonDoubleType()));
|
||||
|
||||
@ -1024,7 +1024,7 @@ DoBinaryArithFallback(JSContext* cx, BaselineFrame* frame, ICBinaryArith_Fallbac
|
||||
// Handle string concat.
|
||||
if (op == JSOP_ADD) {
|
||||
if (lhs.isString() && rhs.isString()) {
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(String, String) stub", js_CodeName[op]);
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(String, String) stub", CodeName[op]);
|
||||
MOZ_ASSERT(ret.isString());
|
||||
ICBinaryArith_StringConcat::Compiler compiler(cx, engine);
|
||||
ICStub* strcatStub = compiler.getStub(compiler.getStubSpace(script));
|
||||
@ -1035,7 +1035,7 @@ DoBinaryArithFallback(JSContext* cx, BaselineFrame* frame, ICBinaryArith_Fallbac
|
||||
}
|
||||
|
||||
if ((lhs.isString() && rhs.isObject()) || (lhs.isObject() && rhs.isString())) {
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(%s, %s) stub", js_CodeName[op],
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(%s, %s) stub", CodeName[op],
|
||||
lhs.isString() ? "String" : "Object",
|
||||
lhs.isString() ? "Object" : "String");
|
||||
MOZ_ASSERT(ret.isString());
|
||||
@ -1053,7 +1053,7 @@ DoBinaryArithFallback(JSContext* cx, BaselineFrame* frame, ICBinaryArith_Fallbac
|
||||
(op == JSOP_ADD || op == JSOP_SUB || op == JSOP_BITOR || op == JSOP_BITAND ||
|
||||
op == JSOP_BITXOR))
|
||||
{
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(%s, %s) stub", js_CodeName[op],
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(%s, %s) stub", CodeName[op],
|
||||
lhs.isBoolean() ? "Boolean" : "Int32", rhs.isBoolean() ? "Boolean" : "Int32");
|
||||
ICBinaryArith_BooleanWithInt32::Compiler compiler(cx, op, engine,
|
||||
lhs.isBoolean(), rhs.isBoolean());
|
||||
@ -1084,7 +1084,7 @@ DoBinaryArithFallback(JSContext* cx, BaselineFrame* frame, ICBinaryArith_Fallbac
|
||||
case JSOP_MOD: {
|
||||
// Unlink int32 stubs, it's faster to always use the double stub.
|
||||
stub->unlinkStubsWithKind(cx, ICStub::BinaryArith_Int32);
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(Double, Double) stub", js_CodeName[op]);
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(Double, Double) stub", CodeName[op]);
|
||||
|
||||
ICBinaryArith_Double::Compiler compiler(cx, op, engine);
|
||||
ICStub* doubleStub = compiler.getStub(compiler.getStubSpace(script));
|
||||
@ -1102,7 +1102,7 @@ DoBinaryArithFallback(JSContext* cx, BaselineFrame* frame, ICBinaryArith_Fallbac
|
||||
bool allowDouble = ret.isDouble();
|
||||
if (allowDouble)
|
||||
stub->unlinkStubsWithKind(cx, ICStub::BinaryArith_Int32);
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(Int32, Int32%s) stub", js_CodeName[op],
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(Int32, Int32%s) stub", CodeName[op],
|
||||
allowDouble ? " => Double" : "");
|
||||
ICBinaryArith_Int32::Compiler compilerInt32(cx, op, engine, allowDouble);
|
||||
ICStub* int32Stub = compilerInt32.getStub(compilerInt32.getStubSpace(script));
|
||||
@ -1120,7 +1120,7 @@ DoBinaryArithFallback(JSContext* cx, BaselineFrame* frame, ICBinaryArith_Fallbac
|
||||
case JSOP_BITOR:
|
||||
case JSOP_BITXOR:
|
||||
case JSOP_BITAND: {
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(%s, %s) stub", js_CodeName[op],
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(%s, %s) stub", CodeName[op],
|
||||
lhs.isDouble() ? "Double" : "Int32",
|
||||
lhs.isDouble() ? "Int32" : "Double");
|
||||
ICBinaryArith_DoubleWithInt32::Compiler compiler(cx, op, engine, lhs.isDouble());
|
||||
@ -1486,7 +1486,7 @@ DoUnaryArithFallback(JSContext* cx, BaselineFrame* frame, ICUnaryArith_Fallback*
|
||||
|
||||
jsbytecode* pc = stub->icEntry()->pc(script);
|
||||
JSOp op = JSOp(*pc);
|
||||
FallbackICSpew(cx, stub, "UnaryArith(%s)", js_CodeName[op]);
|
||||
FallbackICSpew(cx, stub, "UnaryArith(%s)", CodeName[op]);
|
||||
|
||||
switch (op) {
|
||||
case JSOP_BITNOT: {
|
||||
@ -1517,7 +1517,7 @@ DoUnaryArithFallback(JSContext* cx, BaselineFrame* frame, ICUnaryArith_Fallback*
|
||||
}
|
||||
|
||||
if (val.isInt32() && res.isInt32()) {
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(Int32 => Int32) stub", js_CodeName[op]);
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(Int32 => Int32) stub", CodeName[op]);
|
||||
ICUnaryArith_Int32::Compiler compiler(cx, op, engine);
|
||||
ICStub* int32Stub = compiler.getStub(compiler.getStubSpace(script));
|
||||
if (!int32Stub)
|
||||
@ -1527,7 +1527,7 @@ DoUnaryArithFallback(JSContext* cx, BaselineFrame* frame, ICUnaryArith_Fallback*
|
||||
}
|
||||
|
||||
if (val.isNumber() && res.isNumber() && cx->runtime()->jitSupportsFloatingPoint) {
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(Number => Number) stub", js_CodeName[op]);
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(Number => Number) stub", CodeName[op]);
|
||||
|
||||
// Unlink int32 stubs, the double stub handles both cases and TI specializes for both.
|
||||
stub->unlinkStubsWithKind(cx, ICStub::UnaryArith_Int32);
|
||||
@ -1623,7 +1623,7 @@ DoCompareFallback(JSContext* cx, BaselineFrame* frame, ICCompare_Fallback* stub_
|
||||
jsbytecode* pc = stub->icEntry()->pc(script);
|
||||
JSOp op = JSOp(*pc);
|
||||
|
||||
FallbackICSpew(cx, stub, "Compare(%s)", js_CodeName[op]);
|
||||
FallbackICSpew(cx, stub, "Compare(%s)", CodeName[op]);
|
||||
|
||||
// Case operations in a CONDSWITCH are performing strict equality.
|
||||
if (op == JSOP_CASE)
|
||||
@ -1689,7 +1689,7 @@ DoCompareFallback(JSContext* cx, BaselineFrame* frame, ICCompare_Fallback* stub_
|
||||
|
||||
// Try to generate new stubs.
|
||||
if (lhs.isInt32() && rhs.isInt32()) {
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(Int32, Int32) stub", js_CodeName[op]);
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(Int32, Int32) stub", CodeName[op]);
|
||||
ICCompare_Int32::Compiler compiler(cx, op, engine);
|
||||
ICStub* int32Stub = compiler.getStub(compiler.getStubSpace(script));
|
||||
if (!int32Stub)
|
||||
@ -1703,7 +1703,7 @@ DoCompareFallback(JSContext* cx, BaselineFrame* frame, ICCompare_Fallback* stub_
|
||||
return true;
|
||||
|
||||
if (lhs.isNumber() && rhs.isNumber()) {
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(Number, Number) stub", js_CodeName[op]);
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(Number, Number) stub", CodeName[op]);
|
||||
|
||||
// Unlink int32 stubs, it's faster to always use the double stub.
|
||||
stub->unlinkStubsWithKind(cx, ICStub::Compare_Int32);
|
||||
@ -1720,7 +1720,7 @@ DoCompareFallback(JSContext* cx, BaselineFrame* frame, ICCompare_Fallback* stub_
|
||||
if ((lhs.isNumber() && rhs.isUndefined()) ||
|
||||
(lhs.isUndefined() && rhs.isNumber()))
|
||||
{
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(%s, %s) stub", js_CodeName[op],
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(%s, %s) stub", CodeName[op],
|
||||
rhs.isUndefined() ? "Number" : "Undefined",
|
||||
rhs.isUndefined() ? "Undefined" : "Number");
|
||||
ICCompare_NumberWithUndefined::Compiler compiler(cx, op, engine, lhs.isUndefined());
|
||||
@ -1733,7 +1733,7 @@ DoCompareFallback(JSContext* cx, BaselineFrame* frame, ICCompare_Fallback* stub_
|
||||
}
|
||||
|
||||
if (lhs.isBoolean() && rhs.isBoolean()) {
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(Boolean, Boolean) stub", js_CodeName[op]);
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(Boolean, Boolean) stub", CodeName[op]);
|
||||
ICCompare_Boolean::Compiler compiler(cx, op, engine);
|
||||
ICStub* booleanStub = compiler.getStub(compiler.getStubSpace(script));
|
||||
if (!booleanStub)
|
||||
@ -1744,7 +1744,7 @@ DoCompareFallback(JSContext* cx, BaselineFrame* frame, ICCompare_Fallback* stub_
|
||||
}
|
||||
|
||||
if ((lhs.isBoolean() && rhs.isInt32()) || (lhs.isInt32() && rhs.isBoolean())) {
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(%s, %s) stub", js_CodeName[op],
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(%s, %s) stub", CodeName[op],
|
||||
rhs.isInt32() ? "Boolean" : "Int32",
|
||||
rhs.isInt32() ? "Int32" : "Boolean");
|
||||
ICCompare_Int32WithBoolean::Compiler compiler(cx, op, engine, lhs.isInt32());
|
||||
@ -1758,7 +1758,7 @@ DoCompareFallback(JSContext* cx, BaselineFrame* frame, ICCompare_Fallback* stub_
|
||||
|
||||
if (IsEqualityOp(op)) {
|
||||
if (lhs.isString() && rhs.isString() && !stub->hasStub(ICStub::Compare_String)) {
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(String, String) stub", js_CodeName[op]);
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(String, String) stub", CodeName[op]);
|
||||
ICCompare_String::Compiler compiler(cx, op, engine);
|
||||
ICStub* stringStub = compiler.getStub(compiler.getStubSpace(script));
|
||||
if (!stringStub)
|
||||
@ -1770,7 +1770,7 @@ DoCompareFallback(JSContext* cx, BaselineFrame* frame, ICCompare_Fallback* stub_
|
||||
|
||||
if (lhs.isObject() && rhs.isObject()) {
|
||||
MOZ_ASSERT(!stub->hasStub(ICStub::Compare_Object));
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(Object, Object) stub", js_CodeName[op]);
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(Object, Object) stub", CodeName[op]);
|
||||
ICCompare_Object::Compiler compiler(cx, op, engine);
|
||||
ICStub* objectStub = compiler.getStub(compiler.getStubSpace(script));
|
||||
if (!objectStub)
|
||||
@ -1785,7 +1785,7 @@ DoCompareFallback(JSContext* cx, BaselineFrame* frame, ICCompare_Fallback* stub_
|
||||
!stub->hasStub(ICStub::Compare_ObjectWithUndefined))
|
||||
{
|
||||
JitSpew(JitSpew_BaselineIC, " Generating %s(Obj/Null/Undef, Obj/Null/Undef) stub",
|
||||
js_CodeName[op]);
|
||||
CodeName[op]);
|
||||
bool lhsIsUndefined = lhs.isNull() || lhs.isUndefined();
|
||||
bool compareWithNull = lhs.isNull() || rhs.isNull();
|
||||
ICCompare_ObjectWithUndefined::Compiler compiler(cx, op, engine,
|
||||
@ -2968,7 +2968,7 @@ DoGetPropFallback(JSContext* cx, BaselineFrame* frame, ICGetProp_Fallback* stub_
|
||||
|
||||
jsbytecode* pc = stub->icEntry()->pc(script);
|
||||
JSOp op = JSOp(*pc);
|
||||
FallbackICSpew(cx, stub, "GetProp(%s)", js_CodeName[op]);
|
||||
FallbackICSpew(cx, stub, "GetProp(%s)", CodeName[op]);
|
||||
|
||||
MOZ_ASSERT(op == JSOP_GETPROP || op == JSOP_CALLPROP || op == JSOP_LENGTH || op == JSOP_GETXPROP);
|
||||
|
||||
|
@ -552,7 +552,7 @@ SnapshotReader::spewBailingFrom() const
|
||||
if (JitSpewEnabled(JitSpew_IonBailouts)) {
|
||||
JitSpewHeader(JitSpew_IonBailouts);
|
||||
Fprinter& out = JitSpewPrinter();
|
||||
out.printf(" bailing from bytecode: %s, MIR: ", js_CodeName[pcOpcode_]);
|
||||
out.printf(" bailing from bytecode: %s, MIR: ", CodeName[pcOpcode_]);
|
||||
MDefinition::PrintOpcodeName(out, MDefinition::Opcode(mirOpcode_));
|
||||
out.printf(" [%u], LIR: ", mirId_);
|
||||
LInstruction::printName(out, LInstruction::Opcode(lirOpcode_));
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user