Merge m-c to fx-team a=merge CLOSED TREE

This commit is contained in:
Wes Kocher 2015-02-06 14:57:26 -08:00
Родитель ff610ddba5 37dc6c9583
Коммит 8dfdbb45dd
194 изменённых файлов: 3772 добавлений и 3449 удалений

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

@ -319,7 +319,7 @@ pref("media.fragmented-mp4.gonk.enabled", true);
pref("media.video-queue.default-size", 3);
// optimize images' memory usage
pref("image.mem.decodeondraw", true);
pref("image.mem.decodeondraw", false);
pref("image.mem.allow_locking_in_content_processes", false); /* don't allow image locking */
// Limit the surface cache to 1/8 of main memory or 128MB, whichever is smaller.
// Almost everything that was factored into 'max_decoded_image_kb' is now stored

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e06971db7acf7a35c32eb74d675a4e12e288e6be">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0244121522343877d65a69377226a836688e3004"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="a0e71e61922bde009a3b6714cbe965021d3279f1"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

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

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="0244121522343877d65a69377226a836688e3004"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="a0e71e61922bde009a3b6714cbe965021d3279f1"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="eb1795a9002eb142ac58c8d68f8f4ba094af07ca"/>

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

@ -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="0244121522343877d65a69377226a836688e3004"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="a0e71e61922bde009a3b6714cbe965021d3279f1"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e354d8de334a4ad52d131f0575ccf9f79e86cadd"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e06971db7acf7a35c32eb74d675a4e12e288e6be">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0244121522343877d65a69377226a836688e3004"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="a0e71e61922bde009a3b6714cbe965021d3279f1"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

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

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="0244121522343877d65a69377226a836688e3004"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="a0e71e61922bde009a3b6714cbe965021d3279f1"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="eb1795a9002eb142ac58c8d68f8f4ba094af07ca"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e06971db7acf7a35c32eb74d675a4e12e288e6be">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0244121522343877d65a69377226a836688e3004"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="a0e71e61922bde009a3b6714cbe965021d3279f1"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

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

@ -17,7 +17,7 @@
</project>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0244121522343877d65a69377226a836688e3004"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="a0e71e61922bde009a3b6714cbe965021d3279f1"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e354d8de334a4ad52d131f0575ccf9f79e86cadd"/>

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

@ -1,9 +1,9 @@
{
"git": {
"git_revision": "0244121522343877d65a69377226a836688e3004",
"git_revision": "a0e71e61922bde009a3b6714cbe965021d3279f1",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
"revision": "33d9ca589ca27af7f98b29b97a232ca599f111fe",
"revision": "0829f98e30c6f7795f66052d32e25456eb54bda5",
"repo_path": "integration/gaia-central"
}

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

@ -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="0244121522343877d65a69377226a836688e3004"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="a0e71e61922bde009a3b6714cbe965021d3279f1"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e354d8de334a4ad52d131f0575ccf9f79e86cadd"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="7f2ee9f4cb926684883fc2a2e407045fd9db2199">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0244121522343877d65a69377226a836688e3004"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="a0e71e61922bde009a3b6714cbe965021d3279f1"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

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

@ -278,6 +278,17 @@ let ProcessHangMonitor = {
return;
}
// On e10s this counts slow-script/hanged-plugin notice only once.
// This code is not reached on non-e10s.
if (report.hangType == report.SLOW_SCRIPT) {
// On non-e10s, SLOW_SCRIPT_NOTICE_COUNT is probed at nsGlobalWindow.cpp
Services.telemetry.getHistogramById("SLOW_SCRIPT_NOTICE_COUNT").add();
} else if (report.hangType == report.PLUGIN_HANG) {
// On non-e10s we have sufficient plugin telemetry probes,
// so PLUGIN_HANG_NOTICE_COUNT is only probed on e10s.
Services.telemetry.getHistogramById("PLUGIN_HANG_NOTICE_COUNT").add();
}
// Otherwise create a new timer and display the report.
let timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
timer.initWithCallback(this, HANG_EXPIRATION_TIME, timer.TYPE_ONE_SHOT);

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

@ -46,7 +46,7 @@ leak:mozilla::TransportLayerDtls::Setup
###
# Bug 981195 - Small leak in the parser. m4
leak:TypeCompartment::fixObjectGroup
leak:ObjectGroup::fixPlainObjectGroup
# Bug 982111 - WebM is leaking. m1
leak:nestegg_read_packet

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

@ -3078,8 +3078,14 @@ nsGlobalWindow::PreHandleEvent(EventChainPreVisitor& aVisitor)
gEntropyCollector->RandomUpdate((void*)&(aVisitor.mEvent->time),
sizeof(uint32_t));
}
} else if (msg == NS_RESIZE_EVENT) {
} else if (msg == NS_RESIZE_EVENT && aVisitor.mEvent->mFlags.mIsTrusted) {
// QIing to window so that we can keep the old behavior also in case
// a child window is handling resize.
nsCOMPtr<nsPIDOMWindow> window =
do_QueryInterface(aVisitor.mEvent->originalTarget);
if (window) {
mIsHandlingResizeEvent = true;
}
} else if (msg == NS_MOUSE_BUTTON_DOWN &&
aVisitor.mEvent->mFlags.mIsTrusted) {
gMouseDown = true;
@ -7259,7 +7265,7 @@ nsGlobalWindow::ScrollTo(const CSSIntPoint& aScroll,
NS_IMETHODIMP
nsGlobalWindow::ScrollBy(int32_t aXScrollDif, int32_t aYScrollDif)
{
ScrollBy(aXScrollDif, aYScrollDif);
ScrollBy(double(aXScrollDif), double(aYScrollDif));
return NS_OK;
}
@ -11018,6 +11024,10 @@ nsGlobalWindow::ShowSlowScriptDialog()
return ContinueSlowScriptAndKeepNotifying;
}
// Reached only on non-e10s - once per slow script dialog.
// On e10s - we probe once at ProcessHangsMonitor.jsm
Telemetry::Accumulate(Telemetry::SLOW_SCRIPT_NOTICE_COUNT, 1);
// Get the nsIPrompt interface from the docshell
nsCOMPtr<nsIDocShell> ds = GetDocShell();
NS_ENSURE_TRUE(ds, KillSlowScript);

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

@ -37,7 +37,7 @@ interface nsIFrame;
* interface to mirror this interface when changing it.
*/
[scriptable, builtinclass, uuid(ce098f6c-baca-4178-a9aa-266e8bfe509b)]
[scriptable, builtinclass, uuid(5794d12b-3195-4526-a814-a2181f6c71fe)]
interface nsIImageLoadingContent : imgINotificationObserver
{
/**
@ -170,9 +170,17 @@ interface nsIImageLoadingContent : imgINotificationObserver
/**
* A visible count is stored, if it is non-zero then this image is considered
* visible. These methods increment, decrement, or return the visible coount.
* visible. These methods increment, decrement, or return the visible count.
*
* @param aNonvisibleAction What to do if the image's visibility count is now
* zero. If ON_NONVISIBLE_NO_ACTION, nothing will be
* done. If ON_NONVISIBLE_REQUEST_DISCARD, the image
* will be asked to discard its surfaces if possible.
*/
[noscript, notxpcom] void IncrementVisibleCount();
[noscript, notxpcom] void DecrementVisibleCount();
[noscript, notxpcom] void DecrementVisibleCount(in uint32_t aNonvisibleAction);
[noscript, notxpcom] uint32_t GetVisibleCount();
const long ON_NONVISIBLE_NO_ACTION = 0;
const long ON_NONVISIBLE_REQUEST_DISCARD = 1;
};

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

@ -105,8 +105,8 @@ nsImageLoadingContent::DestroyImageLoadingContent()
{
// Cancel our requests so they won't hold stale refs to us
// NB: Don't ask to discard the images here.
ClearCurrentRequest(NS_BINDING_ABORTED, 0);
ClearPendingRequest(NS_BINDING_ABORTED, 0);
ClearCurrentRequest(NS_BINDING_ABORTED, ON_NONVISIBLE_NO_ACTION);
ClearPendingRequest(NS_BINDING_ABORTED, ON_NONVISIBLE_NO_ACTION);
}
nsImageLoadingContent::~nsImageLoadingContent()
@ -554,7 +554,7 @@ nsImageLoadingContent::FrameDestroyed(nsIFrame* aFrame)
if (aFrame->HasAnyStateBits(NS_FRAME_IN_POPUP)) {
// We assume all images in popups are visible, so this decrement balances
// out the increment in FrameCreated above.
DecrementVisibleCount();
DecrementVisibleCount(ON_NONVISIBLE_NO_ACTION);
}
}
@ -777,14 +777,14 @@ nsImageLoadingContent::IncrementVisibleCount()
}
void
nsImageLoadingContent::DecrementVisibleCount()
nsImageLoadingContent::DecrementVisibleCount(uint32_t aNonvisibleAction)
{
NS_ASSERTION(mVisibleCount > 0, "visible count should be positive here");
mVisibleCount--;
if (mVisibleCount == 0) {
UntrackImage(mCurrentRequest);
UntrackImage(mPendingRequest);
UntrackImage(mCurrentRequest, aNonvisibleAction);
UntrackImage(mPendingRequest, aNonvisibleAction);
}
}
@ -1096,8 +1096,8 @@ void
nsImageLoadingContent::CancelImageRequests(bool aNotify)
{
AutoStateChanger changer(this, aNotify);
ClearPendingRequest(NS_BINDING_ABORTED, REQUEST_DISCARD);
ClearCurrentRequest(NS_BINDING_ABORTED, REQUEST_DISCARD);
ClearPendingRequest(NS_BINDING_ABORTED, ON_NONVISIBLE_REQUEST_DISCARD);
ClearCurrentRequest(NS_BINDING_ABORTED, ON_NONVISIBLE_REQUEST_DISCARD);
}
nsresult
@ -1109,8 +1109,8 @@ nsImageLoadingContent::UseAsPrimaryRequest(imgRequestProxy* aRequest,
AutoStateChanger changer(this, aNotify);
// Get rid if our existing images
ClearPendingRequest(NS_BINDING_ABORTED, REQUEST_DISCARD);
ClearCurrentRequest(NS_BINDING_ABORTED, REQUEST_DISCARD);
ClearPendingRequest(NS_BINDING_ABORTED, ON_NONVISIBLE_REQUEST_DISCARD);
ClearCurrentRequest(NS_BINDING_ABORTED, ON_NONVISIBLE_REQUEST_DISCARD);
// Clone the request we were given.
nsRefPtr<imgRequestProxy>& req = PrepareNextRequest(aImageLoadType);
@ -1227,7 +1227,7 @@ nsImageLoadingContent::SetBlockedRequest(nsIURI* aURI, int16_t aContentDecision)
// reason "image source changed". However, apparently there's some abuse
// over in nsImageFrame where the displaying of the "broken" icon for the
// next image depends on the cancel reason of the previous image. ugh.
ClearPendingRequest(NS_ERROR_IMAGE_BLOCKED, REQUEST_DISCARD);
ClearPendingRequest(NS_ERROR_IMAGE_BLOCKED, ON_NONVISIBLE_REQUEST_DISCARD);
// For the blocked case, we only want to cancel the existing current request
// if size is not available. bz says the web depends on this behavior.
@ -1235,7 +1235,7 @@ nsImageLoadingContent::SetBlockedRequest(nsIURI* aURI, int16_t aContentDecision)
mImageBlockingStatus = aContentDecision;
uint32_t keepFlags = mCurrentRequestFlags & REQUEST_IS_IMAGESET;
ClearCurrentRequest(NS_ERROR_IMAGE_BLOCKED, REQUEST_DISCARD);
ClearCurrentRequest(NS_ERROR_IMAGE_BLOCKED, ON_NONVISIBLE_REQUEST_DISCARD);
// We still want to remember what URI we were and if it was an imageset,
// despite not having an actual request. These are both cleared as part of
@ -1253,7 +1253,8 @@ nsImageLoadingContent::PrepareCurrentRequest(ImageLoadType aImageLoadType)
mImageBlockingStatus = nsIContentPolicy::ACCEPT;
// Get rid of anything that was there previously.
ClearCurrentRequest(NS_ERROR_IMAGE_SRC_CHANGED, REQUEST_DISCARD);
ClearCurrentRequest(NS_ERROR_IMAGE_SRC_CHANGED,
ON_NONVISIBLE_REQUEST_DISCARD);
if (mNewRequestsWillNeedAnimationReset) {
mCurrentRequestFlags |= REQUEST_NEEDS_ANIMATION_RESET;
@ -1271,7 +1272,8 @@ nsRefPtr<imgRequestProxy>&
nsImageLoadingContent::PreparePendingRequest(ImageLoadType aImageLoadType)
{
// Get rid of anything that was there previously.
ClearPendingRequest(NS_ERROR_IMAGE_SRC_CHANGED, REQUEST_DISCARD);
ClearPendingRequest(NS_ERROR_IMAGE_SRC_CHANGED,
ON_NONVISIBLE_REQUEST_DISCARD);
if (mNewRequestsWillNeedAnimationReset) {
mPendingRequestFlags |= REQUEST_NEEDS_ANIMATION_RESET;
@ -1336,7 +1338,7 @@ nsImageLoadingContent::MakePendingRequestCurrent()
void
nsImageLoadingContent::ClearCurrentRequest(nsresult aReason,
uint32_t aFlags)
uint32_t aNonvisibleAction)
{
if (!mCurrentRequest) {
// Even if we didn't have a current request, we might have been keeping
@ -1354,7 +1356,7 @@ nsImageLoadingContent::ClearCurrentRequest(nsresult aReason,
&mCurrentRequestRegistered);
// Clean up the request.
UntrackImage(mCurrentRequest, aFlags);
UntrackImage(mCurrentRequest, aNonvisibleAction);
mCurrentRequest->CancelAndForgetObserver(aReason);
mCurrentRequest = nullptr;
mCurrentRequestFlags = 0;
@ -1362,7 +1364,7 @@ nsImageLoadingContent::ClearCurrentRequest(nsresult aReason,
void
nsImageLoadingContent::ClearPendingRequest(nsresult aReason,
uint32_t aFlags)
uint32_t aNonvisibleAction)
{
if (!mPendingRequest)
return;
@ -1372,7 +1374,7 @@ nsImageLoadingContent::ClearPendingRequest(nsresult aReason,
nsLayoutUtils::DeregisterImageRequest(GetFramePresContext(), mPendingRequest,
&mPendingRequestRegistered);
UntrackImage(mPendingRequest, aFlags);
UntrackImage(mPendingRequest, aNonvisibleAction);
mPendingRequest->CancelAndForgetObserver(aReason);
mPendingRequest = nullptr;
mPendingRequestFlags = 0;
@ -1472,7 +1474,9 @@ nsImageLoadingContent::TrackImage(imgIRequest* aImage)
}
void
nsImageLoadingContent::UntrackImage(imgIRequest* aImage, uint32_t aFlags /* = 0 */)
nsImageLoadingContent::UntrackImage(imgIRequest* aImage,
uint32_t aNonvisibleAction
/* = ON_NONVISIBLE_NO_ACTION */)
{
if (!aImage)
return;
@ -1489,9 +1493,10 @@ nsImageLoadingContent::UntrackImage(imgIRequest* aImage, uint32_t aFlags /* = 0
if (doc && (mCurrentRequestFlags & REQUEST_IS_TRACKED)) {
mCurrentRequestFlags &= ~REQUEST_IS_TRACKED;
doc->RemoveImage(mCurrentRequest,
(aFlags & REQUEST_DISCARD) ? nsIDocument::REQUEST_DISCARD : 0);
}
else if (aFlags & REQUEST_DISCARD) {
(aNonvisibleAction == ON_NONVISIBLE_REQUEST_DISCARD)
? nsIDocument::REQUEST_DISCARD
: 0);
} else if (aNonvisibleAction == ON_NONVISIBLE_REQUEST_DISCARD) {
// If we're not in the document we may still need to be discarded.
aImage->RequestDiscard();
}
@ -1500,9 +1505,10 @@ nsImageLoadingContent::UntrackImage(imgIRequest* aImage, uint32_t aFlags /* = 0
if (doc && (mPendingRequestFlags & REQUEST_IS_TRACKED)) {
mPendingRequestFlags &= ~REQUEST_IS_TRACKED;
doc->RemoveImage(mPendingRequest,
(aFlags & REQUEST_DISCARD) ? nsIDocument::REQUEST_DISCARD : 0);
}
else if (aFlags & REQUEST_DISCARD) {
(aNonvisibleAction == ON_NONVISIBLE_REQUEST_DISCARD)
? nsIDocument::REQUEST_DISCARD
: 0);
} else if (aNonvisibleAction == ON_NONVISIBLE_REQUEST_DISCARD) {
// If we're not in the document we may still need to be discarded.
aImage->RequestDiscard();
}

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

@ -316,9 +316,12 @@ protected:
/**
* Cancels and nulls-out the "current" and "pending" requests if they exist.
*
* @param aNonvisibleAction An action to take if the image is no longer
* visible as a result; see |UntrackImage|.
*/
void ClearCurrentRequest(nsresult aReason, uint32_t aFlags);
void ClearPendingRequest(nsresult aReason, uint32_t aFlags);
void ClearCurrentRequest(nsresult aReason, uint32_t aNonvisibleAction);
void ClearPendingRequest(nsresult aReason, uint32_t aNonvisibleAction);
/**
* Retrieve a pointer to the 'registered with the refresh driver' flag for
@ -347,14 +350,14 @@ protected:
*
* No-op if aImage is null.
*
* REQUEST_DISCARD passed to UntrackImage means we request the discard of the
* decoded data of the image.
* @param aNonvisibleAction What to do if the image's visibility count is now
* zero. If ON_NONVISIBLE_NO_ACTION, nothing will be
* done. If ON_NONVISIBLE_REQUEST_DISCARD, the image
* will be asked to discard its surfaces if possible.
*/
void TrackImage(imgIRequest* aImage);
enum {
REQUEST_DISCARD = 0x1
};
void UntrackImage(imgIRequest* aImage, uint32_t aFlags = 0);
void UntrackImage(imgIRequest* aImage,
uint32_t aNonvisibleAction = ON_NONVISIBLE_NO_ACTION);
/* MEMBERS */
nsRefPtr<imgRequestProxy> mCurrentRequest;

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

@ -773,3 +773,5 @@ skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s
skip-if = true # bug 1107443 - code for newly-added test was disabled
[test_root_iframe.html]
[test_performance_user_timing.html]
[test_bug1126851.html]
skip-if = buildapp == 'mulet' || buildapp == 'b2g'

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

@ -0,0 +1,44 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1126851
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 1126851</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
/** Test for Bug 1126851 **/
SimpleTest.waitForExplicitFinish();
function runTest() {
win = window.open("about:blank", "");
win.onload = function() {
win.onunload = function() {
ok(true, "got unload");
win.close();
SimpleTest.finish();
}
win.onresize = function() {
win.location.reload();
}
win.document.dispatchEvent(new win.Event("resize", { bubbles: true }));
}
}
</script>
</head>
<body onload="runTest()">
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1126851">Mozilla Bug 1126851</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
</html>

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

@ -195,12 +195,12 @@ private:
ErrorResult& mRv;
};
class PostMessageRunnable MOZ_FINAL : public nsICancelableRunnable
class BCPostMessageRunnable MOZ_FINAL : public nsICancelableRunnable
{
public:
NS_DECL_ISUPPORTS
PostMessageRunnable(BroadcastChannelChild* aActor,
BCPostMessageRunnable(BroadcastChannelChild* aActor,
BroadcastChannelMessage* aData)
: mActor(aActor)
, mData(aData)
@ -249,13 +249,13 @@ public:
}
private:
~PostMessageRunnable() {}
~BCPostMessageRunnable() {}
nsRefPtr<BroadcastChannelChild> mActor;
nsRefPtr<BroadcastChannelMessage> mData;
};
NS_IMPL_ISUPPORTS(PostMessageRunnable, nsICancelableRunnable, nsIRunnable)
NS_IMPL_ISUPPORTS(BCPostMessageRunnable, nsICancelableRunnable, nsIRunnable)
class CloseRunnable MOZ_FINAL : public nsICancelableRunnable
{
@ -559,8 +559,8 @@ void
BroadcastChannel::PostMessageData(BroadcastChannelMessage* aData)
{
if (mActor) {
nsRefPtr<PostMessageRunnable> runnable =
new PostMessageRunnable(mActor, aData);
nsRefPtr<BCPostMessageRunnable> runnable =
new BCPostMessageRunnable(mActor, aData);
if (NS_FAILED(NS_DispatchToCurrentThread(runnable))) {
NS_WARNING("Failed to dispatch to the current thread!");

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

@ -8,7 +8,7 @@ EXPORTS.mozilla.dom += [
'BroadcastChannel.h',
]
SOURCES += [
UNIFIED_SOURCES += [
'BroadcastChannel.cpp',
'BroadcastChannelChild.cpp',
'BroadcastChannelParent.cpp',

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

@ -109,7 +109,10 @@ function test3(e) {
numPendingChildTests++;
onTryAgain();
waitForPendingTests(function() { test4(); });
waitForPendingTests(function() {
mm.removeMessageListener('test-try-again', onTryAgain);
test4();
});
}
function test4() {
@ -240,7 +243,10 @@ function test6f() {
numPendingChildTests++;
onTryAgain();
waitForPendingTests(test6g);
waitForPendingTests(function() {
mm.removeMessageListener('test-try-again', onTryAgain);
test6g();
});
}
function test6g() {
@ -269,7 +275,10 @@ function test6g() {
numPendingChildTests++;
onTryAgain();
waitForPendingTests(test6h);
waitForPendingTests(function() {
mm.removeMessageListener('test-try-again', onTryAgain);
test6h();
});
}
function test6h() {

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

@ -505,7 +505,7 @@ IsFeatureInBlacklist(const nsCOMPtr<nsIGfxInfo>& gfxInfo, int32_t feature)
static already_AddRefed<GLContext>
CreateHeadlessNativeGL(bool forceEnabled, const nsCOMPtr<nsIGfxInfo>& gfxInfo,
bool requireCompatProfile, WebGLContext* webgl)
WebGLContext* webgl)
{
if (!forceEnabled &&
IsFeatureInBlacklist(gfxInfo, nsIGfxInfo::FEATURE_WEBGL_OPENGL))
@ -515,7 +515,7 @@ CreateHeadlessNativeGL(bool forceEnabled, const nsCOMPtr<nsIGfxInfo>& gfxInfo,
return nullptr;
}
nsRefPtr<GLContext> gl = gl::GLContextProvider::CreateHeadless(requireCompatProfile);
nsRefPtr<GLContext> gl = gl::GLContextProvider::CreateHeadless();
if (!gl) {
webgl->GenerateWarning("Error during native OpenGL init.");
return nullptr;
@ -530,7 +530,7 @@ CreateHeadlessNativeGL(bool forceEnabled, const nsCOMPtr<nsIGfxInfo>& gfxInfo,
// Eventually, we want to be able to pick ANGLE-EGL or native EGL.
static already_AddRefed<GLContext>
CreateHeadlessANGLE(bool forceEnabled, const nsCOMPtr<nsIGfxInfo>& gfxInfo,
bool requireCompatProfile, WebGLContext* webgl)
WebGLContext* webgl)
{
nsRefPtr<GLContext> gl;
@ -543,7 +543,7 @@ CreateHeadlessANGLE(bool forceEnabled, const nsCOMPtr<nsIGfxInfo>& gfxInfo,
return nullptr;
}
gl = gl::GLContextProviderEGL::CreateHeadless(requireCompatProfile);
gl = gl::GLContextProviderEGL::CreateHeadless();
if (!gl) {
webgl->GenerateWarning("Error during ANGLE OpenGL init.");
return nullptr;
@ -555,13 +555,13 @@ CreateHeadlessANGLE(bool forceEnabled, const nsCOMPtr<nsIGfxInfo>& gfxInfo,
}
static already_AddRefed<GLContext>
CreateHeadlessEGL(bool forceEnabled, bool requireCompatProfile,
CreateHeadlessEGL(bool forceEnabled, const nsCOMPtr<nsIGfxInfo>& gfxInfo,
WebGLContext* webgl)
{
nsRefPtr<GLContext> gl;
#ifdef ANDROID
gl = gl::GLContextProviderEGL::CreateHeadless(requireCompatProfile);
gl = gl::GLContextProviderEGL::CreateHeadless();
if (!gl) {
webgl->GenerateWarning("Error during EGL OpenGL init.");
return nullptr;
@ -583,22 +583,16 @@ CreateHeadlessGL(bool forceEnabled, const nsCOMPtr<nsIGfxInfo>& gfxInfo,
if (PR_GetEnv("MOZ_WEBGL_FORCE_OPENGL"))
disableANGLE = true;
bool requireCompatProfile = webgl->IsWebGL2() ? false : true;
nsRefPtr<GLContext> gl;
if (preferEGL)
gl = CreateHeadlessEGL(forceEnabled, requireCompatProfile, webgl);
gl = CreateHeadlessEGL(forceEnabled, gfxInfo, webgl);
if (!gl && !disableANGLE) {
gl = CreateHeadlessANGLE(forceEnabled, gfxInfo, requireCompatProfile,
webgl);
}
if (!gl && !disableANGLE)
gl = CreateHeadlessANGLE(forceEnabled, gfxInfo, webgl);
if (!gl) {
gl = CreateHeadlessNativeGL(forceEnabled, gfxInfo,
requireCompatProfile, webgl);
}
if (!gl)
gl = CreateHeadlessNativeGL(forceEnabled, gfxInfo, webgl);
return gl.forget();
}

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

@ -1209,10 +1209,9 @@ protected:
// -------------------------------------------------------------------------
// WebGL 2 specifics (implemented in WebGL2Context.cpp)
public:
virtual bool IsWebGL2() const = 0;
protected:
bool InitWebGL2();
// -------------------------------------------------------------------------

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

@ -2106,6 +2106,7 @@ WebGLContext::ReadPixels(GLint x, GLint y, GLsizei width,
// if we're reading alpha, we may need to do fixup. Note that we don't allow
// GL_ALPHA to readpixels currently, but we had the code written for it already.
const bool formatHasAlpha = format == LOCAL_GL_ALPHA ||
format == LOCAL_GL_RGBA;
if (!formatHasAlpha)

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

@ -1117,12 +1117,11 @@ WebGLContext::AssertCachedState()
AssertUintParamCorrect(gl, LOCAL_GL_STENCIL_CLEAR_VALUE, mStencilClearValue);
GLint stencilBits = 0;
if (GetStencilBits(&stencilBits)) {
gl->fGetIntegerv(LOCAL_GL_STENCIL_BITS, &stencilBits);
const GLuint stencilRefMask = (1 << stencilBits) - 1;
AssertMaskedUintParamCorrect(gl, LOCAL_GL_STENCIL_REF, stencilRefMask, mStencilRefFront);
AssertMaskedUintParamCorrect(gl, LOCAL_GL_STENCIL_BACK_REF, stencilRefMask, mStencilRefBack);
}
// GLES 3.0.4, $4.1.4, p177:
// [...] the front and back stencil mask are both set to the value `2^s - 1`, where

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

@ -1779,8 +1779,8 @@ WebGLContext::InitAndValidateGL()
MakeContextCurrent();
// For OpenGL compat. profiles, we always keep vertex attrib 0 array enabled.
if (gl->IsCompatibilityProfile())
// on desktop OpenGL, we always keep vertex attrib 0 array enabled
if (!gl->IsGLES())
gl->fEnableVertexAttribArray(0);
if (MinCapabilityMode())
@ -1889,7 +1889,7 @@ WebGLContext::InitAndValidateGL()
// Always 1 for GLES2
mMaxFramebufferColorAttachments = 1;
if (gl->IsCompatibilityProfile()) {
if (!gl->IsGLES()) {
// gl_PointSize is always available in ES2 GLSL, but has to be
// specifically enabled on desktop GLSL.
gl->fEnable(LOCAL_GL_VERTEX_PROGRAM_POINT_SIZE);

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

@ -481,32 +481,9 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
mCurrentTarget = aTargetFrame;
mCurrentTargetContent = nullptr;
// Focus events don't necessarily need a frame.
if (NS_EVENT_NEEDS_FRAME(aEvent)) {
NS_ASSERTION(mCurrentTarget, "mCurrentTarget is null. this should not happen. see bug #13007");
if (!mCurrentTarget) return NS_ERROR_NULL_POINTER;
}
#ifdef DEBUG
if (aEvent->HasDragEventMessage() && sIsPointerLocked) {
NS_ASSERTION(sIsPointerLocked,
"sIsPointerLocked is true. Drag events should be suppressed when the pointer is locked.");
}
#endif
// Store last known screenPoint and clientPoint so pointer lock
// can use these values as constants.
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
if (aEvent->mFlags.mIsTrusted &&
((mouseEvent && mouseEvent->IsReal()) ||
aEvent->mClass == eWheelEventClass) &&
!sIsPointerLocked) {
sLastScreenPoint =
UIEvent::CalculateScreenPoint(aPresContext, aEvent);
sLastClientPoint =
UIEvent::CalculateClientPoint(aPresContext, aEvent, nullptr);
}
// Do not take account NS_MOUSE_ENTER/EXIT so that loading a page
// when user is not active doesn't change the state to active.
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
if (aEvent->mFlags.mIsTrusted &&
((mouseEvent && mouseEvent->IsReal() &&
mouseEvent->message != NS_MOUSE_ENTER &&
@ -524,10 +501,35 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
++gMouseOrKeyboardEventCounter;
}
*aStatus = nsEventStatus_eIgnore;
WheelTransaction::OnEvent(aEvent);
// Focus events don't necessarily need a frame.
if (NS_EVENT_NEEDS_FRAME(aEvent)) {
if (!mCurrentTarget) {
return NS_ERROR_NULL_POINTER;
}
}
#ifdef DEBUG
if (aEvent->HasDragEventMessage() && sIsPointerLocked) {
NS_ASSERTION(sIsPointerLocked,
"sIsPointerLocked is true. Drag events should be suppressed when "
"the pointer is locked.");
}
#endif
// Store last known screenPoint and clientPoint so pointer lock
// can use these values as constants.
if (aEvent->mFlags.mIsTrusted &&
((mouseEvent && mouseEvent->IsReal()) ||
aEvent->mClass == eWheelEventClass) &&
!sIsPointerLocked) {
sLastScreenPoint =
UIEvent::CalculateScreenPoint(aPresContext, aEvent);
sLastClientPoint =
UIEvent::CalculateClientPoint(aPresContext, aEvent, nullptr);
}
*aStatus = nsEventStatus_eIgnore;
switch (aEvent->message) {
case NS_CONTEXTMENU:
if (sIsPointerLocked) {

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

@ -200,6 +200,12 @@ MessageEvent::SetPorts(MessagePortList* aPorts)
mPorts = aPorts;
}
void
MessageEvent::SetSource(mozilla::dom::MessagePort* aPort)
{
mPortSource = aPort;
}
} // namespace dom
} // namespace mozilla

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

@ -58,10 +58,7 @@ public:
void SetPorts(MessagePortList* aPorts);
// Non WebIDL methods
void SetSource(mozilla::dom::MessagePort* aPort)
{
mPortSource = aPort;
}
void SetSource(mozilla::dom::MessagePort* aPort);
void SetSource(nsPIDOMWindow* aWindow)
{

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

@ -96,7 +96,6 @@ shouldThrow(function() {
var getOwn = 0;
var defineProp = 0;
var _has = 0;
var handler2 = {
getOwnPropertyDescriptor: function(target, name) {
if (name == "constructor") {
@ -109,12 +108,6 @@ var handler2 = {
defineProp++;
}
return Object.defineProperty(target, name, propertyDescriptor);
},
has: function(target, name) {
if (name == "constructor") {
_has++;
}
return name in target;
}
};
var proxy2 = new Proxy({}, handler2);
@ -125,8 +118,6 @@ document.registerElement('x-proxymagic2', {
is(getOwn, 1, "number of getOwnPropertyDescriptor calls from registerElement: " + getOwn);
is(defineProp, 1, "number of defineProperty calls from registerElement: " + defineProp);
is(_has, 1, "number of 'has' calls from registerElement: " + _has);
</script>
</head>

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

@ -2419,6 +2419,17 @@ TabParent::MaybeForwardEventToRenderFrame(WidgetInputEvent& aEvent,
// id.
if (aOutTargetGuid) {
*aOutTargetGuid = InputAPZContext::GetTargetLayerGuid();
// There may be cases where the APZ hit-testing code came to a different
// conclusion than the main-thread hit-testing code as to where the event
// is destined. In such cases the layersId of the APZ result may not match
// the layersId of this renderframe. In such cases the main-thread hit-
// testing code "wins" so we need to update the guid to reflect this.
if (RenderFrameParent* rfp = GetRenderFrame()) {
if (aOutTargetGuid->mLayersId != rfp->GetLayersId()) {
*aOutTargetGuid = ScrollableLayerGuid(rfp->GetLayersId(), 0, FrameMetrics::NULL_SCROLL_ID);
}
}
}
if (aOutInputBlockId) {
*aOutInputBlockId = InputAPZContext::GetInputBlockId();

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

@ -179,7 +179,7 @@ protected:
return true;
}
mGLContext = GLContextProvider::CreateHeadless(false);
mGLContext = GLContextProvider::CreateHeadless();
return mGLContext;
}

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

@ -91,8 +91,9 @@ static nsRefPtr<GLContext> sPluginContext = nullptr;
static bool EnsureGLContext()
{
if (!sPluginContext) {
bool requireCompatProfile = true;
sPluginContext = GLContextProvider::CreateHeadless(requireCompatProfile);
gfxIntSize dummySize(16, 16);
sPluginContext = GLContextProvider::CreateOffscreen(dummySize,
SurfaceCaps::Any());
}
return sPluginContext != nullptr;

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

@ -8,7 +8,6 @@
#include "nsContentUtils.h"
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/WorkerScope.h"
#include "mozilla/dom/workers/bindings/ServiceWorker.h"

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

@ -9,12 +9,7 @@
#include "mozilla/dom/Event.h"
#include "mozilla/dom/ExtendableEventBinding.h"
#include "mozilla/dom/InstallEventBinding.h"
namespace mozilla {
namespace dom {
class Promise;
} // namespace dom
} // namespace mozilla
#include "mozilla/dom/Promise.h"
BEGIN_WORKERS_NAMESPACE

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

@ -8,7 +8,6 @@
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <vector>
#include "GLContext.h"
#include "GLBlitHelper.h"
@ -157,7 +156,8 @@ static const char *sExtensionNames[] = {
"GL_OES_texture_half_float",
"GL_OES_texture_half_float_linear",
"GL_OES_texture_npot",
"GL_OES_vertex_array_object"
"GL_OES_vertex_array_object",
nullptr
};
static bool
@ -501,8 +501,6 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl)
mInitialized = LoadSymbols(&symbols[0], trygl, prefix);
MakeCurrent();
if (mInitialized) {
MOZ_ASSERT(mProfile != ContextProfile::Unknown);
uint32_t version = 0;
ParseGLVersion(this, &version);
@ -658,15 +656,6 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl)
}
}
if (IsFeatureProvidedByCoreSymbols(GLFeature::get_string_indexed)) {
SymLoadStruct moreSymbols[] = {
{ (PRFuncPtr*) &mSymbols.fGetStringi, { "GetStringi", nullptr } },
END_SYMBOLS
};
MOZ_ALWAYS_TRUE(LoadSymbols(moreSymbols, trygl, prefix));
}
InitExtensions();
InitFeatures();
@ -681,6 +670,12 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl)
MarkUnsupported(GLFeature::standard_derivatives);
}
if (Vendor() == GLVendor::Imagination &&
Renderer() == GLRenderer::SGX540) {
// Bug 980048
MarkExtensionUnsupported(OES_EGL_sync);
}
if (Renderer() == GLRenderer::MicrosoftBasicRenderDriver) {
// Bug 978966: on Microsoft's "Basic Render Driver" (software renderer)
// multisampling hardcodes blending with the default blendfunc, which breaks WebGL.
@ -1473,13 +1468,10 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl)
// We're ready for final setup.
fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, 0);
// TODO: Remove SurfaceCaps::any.
if (mCaps.any) {
mCaps.any = false;
mCaps.color = true;
mCaps.alpha = false;
}
if (mCaps.any)
DetermineCaps();
UpdatePixelFormat();
UpdateGLFormats(mCaps);
mTexGarbageBin = new TextureGarbageBin(this);
@ -1601,63 +1593,31 @@ GLContext::DebugCallback(GLenum source,
void
GLContext::InitExtensions()
{
MOZ_ASSERT(IsCurrent());
MakeCurrent();
const char* extensions = (const char*)fGetString(LOCAL_GL_EXTENSIONS);
if (!extensions)
return;
std::vector<nsCString> driverExtensionList;
InitializeExtensionsBitSet(mAvailableExtensions, extensions,
sExtensionNames);
if (IsFeatureProvidedByCoreSymbols(GLFeature::get_string_indexed)) {
GLuint count = 0;
GetUIntegerv(LOCAL_GL_NUM_EXTENSIONS, &count);
for (GLuint i = 0; i < count; i++) {
// This is UTF-8.
const char* rawExt = (const char*)fGetStringi(LOCAL_GL_EXTENSIONS, i);
if (WorkAroundDriverBugs() &&
Vendor() == GLVendor::Qualcomm) {
// We CANNOT use nsDependentCString here, because the spec doesn't guarantee
// that the pointers returned are different, only that their contents are.
// On Flame, each of these index string queries returns the same address.
driverExtensionList.push_back(nsCString(rawExt));
}
} else {
MOZ_ALWAYS_TRUE(!fGetError());
const char* rawExts = (const char*)fGetString(LOCAL_GL_EXTENSIONS);
MOZ_ALWAYS_TRUE(!fGetError());
if (rawExts) {
nsDependentCString exts(rawExts);
SplitByChar(exts, ' ', &driverExtensionList);
}
}
const bool shouldDumpExts = ShouldDumpExts();
if (shouldDumpExts) {
printf_stderr("%i GL driver extensions: (*: recognized)\n",
(uint32_t)driverExtensionList.size());
}
MarkBitfieldByStrings(driverExtensionList, shouldDumpExts, sExtensionNames,
&mAvailableExtensions);
if (WorkAroundDriverBugs()) {
if (Vendor() == GLVendor::Qualcomm) {
// Some Adreno drivers do not report GL_OES_EGL_sync, but they really do support it.
MarkExtensionSupported(OES_EGL_sync);
}
if (Vendor() == GLVendor::Imagination &&
Renderer() == GLRenderer::SGX540)
{
// Bug 980048
MarkExtensionUnsupported(OES_EGL_sync);
}
if (Renderer() == GLRenderer::AndroidEmulator) {
if (WorkAroundDriverBugs() &&
Renderer() == GLRenderer::AndroidEmulator) {
// the Android emulator, which we use to run B2G reftests on,
// doesn't expose the OES_rgb8_rgba8 extension, but it seems to
// support it (tautologically, as it only runs on desktop GL).
MarkExtensionSupported(OES_rgb8_rgba8);
}
if (Vendor() == GLVendor::VMware &&
if (WorkAroundDriverBugs() &&
Vendor() == GLVendor::VMware &&
Renderer() == GLRenderer::GalliumLlvmpipe)
{
// The llvmpipe driver that is used on linux try servers appears to have
@ -1674,7 +1634,8 @@ GLContext::InitExtensions()
// 3000 appears to be buggy WRT updating sub-images of S3TC
// textures with glCompressedTexSubImage2D. Works on Intel HD 4000
// and Intel HD 5000/Iris that I tested.
if (nsCocoaFeatures::OSXVersionMajor() == 10 &&
if (WorkAroundDriverBugs() &&
nsCocoaFeatures::OSXVersionMajor() == 10 &&
nsCocoaFeatures::OSXVersionMinor() == 9 &&
Renderer() == GLRenderer::IntelHD3000)
{
@ -1683,19 +1644,6 @@ GLContext::InitExtensions()
#endif
}
if (shouldDumpExts) {
printf_stderr("\nActivated extensions:\n");
for (size_t i = 0; i < mAvailableExtensions.size(); i++) {
if (!mAvailableExtensions[i])
continue;
const char* ext = sExtensionNames[i];
printf_stderr("[%i] %s\n", (uint32_t)i, ext);
}
}
}
void
GLContext::PlatformStartup()
{
@ -1740,6 +1688,66 @@ GLContext::ListHasExtension(const GLubyte *extensions, const char *extension)
return false;
}
void
GLContext::DetermineCaps()
{
PixelBufferFormat format = QueryPixelFormat();
SurfaceCaps caps;
caps.color = !!format.red && !!format.green && !!format.blue;
caps.bpp16 = caps.color && format.ColorBits() == 16;
caps.alpha = !!format.alpha;
caps.depth = !!format.depth;
caps.stencil = !!format.stencil;
caps.antialias = format.samples > 1;
caps.preserve = true;
mCaps = caps;
}
PixelBufferFormat
GLContext::QueryPixelFormat()
{
PixelBufferFormat format;
ScopedBindFramebuffer autoFB(this, 0);
fGetIntegerv(LOCAL_GL_RED_BITS , &format.red );
fGetIntegerv(LOCAL_GL_GREEN_BITS, &format.green);
fGetIntegerv(LOCAL_GL_BLUE_BITS , &format.blue );
fGetIntegerv(LOCAL_GL_ALPHA_BITS, &format.alpha);
fGetIntegerv(LOCAL_GL_DEPTH_BITS, &format.depth);
fGetIntegerv(LOCAL_GL_STENCIL_BITS, &format.stencil);
fGetIntegerv(LOCAL_GL_SAMPLES, &format.samples);
return format;
}
void
GLContext::UpdatePixelFormat()
{
PixelBufferFormat format = QueryPixelFormat();
#ifdef MOZ_GL_DEBUG
const SurfaceCaps& caps = Caps();
MOZ_ASSERT(!caps.any, "Did you forget to DetermineCaps()?");
MOZ_ASSERT(caps.color == !!format.red);
MOZ_ASSERT(caps.color == !!format.green);
MOZ_ASSERT(caps.color == !!format.blue);
// These we either must have if they're requested, or
// we can have if they're not.
MOZ_ASSERT(caps.alpha == !!format.alpha || !caps.alpha);
MOZ_ASSERT(caps.depth == !!format.depth || !caps.depth);
MOZ_ASSERT(caps.stencil == !!format.stencil || !caps.stencil);
MOZ_ASSERT(caps.antialias == (format.samples > 1));
#endif
mPixelFormat = new PixelBufferFormat(format);
}
GLFormats
GLContext::ChooseGLFormats(const SurfaceCaps& caps) const
{
@ -2409,13 +2417,6 @@ GLContext::FlushIfHeavyGLCallsSinceLastFlush()
fFlush();
}
/*static*/ bool
GLContext::ShouldDumpExts()
{
static bool ret = PR_GetEnv("MOZ_GL_DUMP_EXTS");
return ret;
}
bool
DoesStringMatch(const char* aString, const char *aWantedString)
{
@ -2443,29 +2444,8 @@ DoesStringMatch(const char* aString, const char *aWantedString)
/*static*/ bool
GLContext::ShouldSpew()
{
static bool ret = PR_GetEnv("MOZ_GL_SPEW");
return ret;
}
void
SplitByChar(const nsACString& str, const char delim, std::vector<nsCString>* const out)
{
uint32_t start = 0;
while (true) {
int32_t end = str.FindChar(' ', start);
if (end == -1)
break;
uint32_t len = (uint32_t)end - start;
nsDependentCSubstring substr(str, start, len);
out->push_back(nsCString(substr));
start = end + 1;
continue;
}
nsDependentCSubstring substr(str, start);
out->push_back(nsCString(substr));
static bool spew = PR_GetEnv("MOZ_GL_SPEW");
return spew;
}
} /* namespace gl */

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

@ -104,7 +104,6 @@ enum class GLFeature {
get_integer_indexed,
get_integer64_indexed,
get_query_object_iv,
get_string_indexed,
gpu_shader4,
instanced_arrays,
instanced_non_arrays,
@ -309,6 +308,7 @@ public:
virtual bool IsCurrent() = 0;
protected:
bool mInitialized;
bool mIsOffscreen;
bool mIsGlobalSharedContext;
@ -325,12 +325,9 @@ protected:
GLVendor mVendor;
GLRenderer mRenderer;
void SetProfileVersion(ContextProfile profile, uint32_t version) {
MOZ_ASSERT(!mInitialized, "SetProfileVersion can only be called before"
" initialization!");
MOZ_ASSERT(profile != ContextProfile::Unknown &&
profile != ContextProfile::OpenGL,
"Invalid `profile` for SetProfileVersion");
inline void SetProfileVersion(ContextProfile profile, unsigned int version) {
MOZ_ASSERT(!mInitialized, "SetProfileVersion can only be called before initialization!");
MOZ_ASSERT(profile != ContextProfile::Unknown && profile != ContextProfile::OpenGL, "Invalid `profile` for SetProfileVersion");
MOZ_ASSERT(version >= 100, "Invalid `version` for SetProfileVersion");
mVersion = version;
@ -460,7 +457,6 @@ public:
return mAvailableExtensions[aKnownExtension];
}
protected:
void MarkExtensionUnsupported(GLExtensions aKnownExtension) {
mAvailableExtensions[aKnownExtension] = 0;
}
@ -469,6 +465,42 @@ protected:
mAvailableExtensions[aKnownExtension] = 1;
}
public:
template<size_t N>
static void InitializeExtensionsBitSet(std::bitset<N>& extensionsBitset,
const char* extStr,
const char** extList)
{
char* exts = ::strdup(extStr);
if (ShouldSpew())
printf_stderr("Extensions: %s\n", exts);
char* cur = exts;
bool done = false;
while (!done) {
char* space = strchr(cur, ' ');
if (space) {
*space = '\0';
} else {
done = true;
}
for (int i = 0; extList[i]; ++i) {
if (PL_strcasecmp(cur, extList[i]) == 0) {
if (ShouldSpew())
printf_stderr("Found extension %s\n", cur);
extensionsBitset[i] = true;
}
}
cur = space + 1;
}
free(exts);
}
protected:
std::bitset<Extensions_Max> mAvailableExtensions;
// -----------------------------------------------------------------------------
@ -3148,17 +3180,6 @@ public:
AFTER_GL_CALL;
}
// -----------------------------------------------------------------------------
// get_string_indexed
const GLubyte* fGetStringi(GLenum name, GLuint index) {
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGetStringi);
const GLubyte* ret = mSymbols.fGetStringi(name, index);
AFTER_GL_CALL;
return ret;
}
// -----------------------------------------------------------------------------
// Constructor
protected:
@ -3427,9 +3448,11 @@ public:
fViewport(0, 0, size.width, size.height);
mCaps = mScreen->mCaps;
MOZ_ASSERT(!mCaps.any);
if (mCaps.any)
DetermineCaps();
UpdateGLFormats(mCaps);
UpdatePixelFormat();
return true;
}
@ -3452,8 +3475,10 @@ public:
protected:
SurfaceCaps mCaps;
nsAutoPtr<GLFormats> mGLFormats;
nsAutoPtr<PixelBufferFormat> mPixelFormat;
public:
void DetermineCaps();
const SurfaceCaps& Caps() const {
return mCaps;
}
@ -3469,6 +3494,14 @@ public:
return *mGLFormats;
}
PixelBufferFormat QueryPixelFormat();
void UpdatePixelFormat();
const PixelBufferFormat& GetPixelFormat() const {
MOZ_ASSERT(mPixelFormat);
return *mPixelFormat;
}
bool IsFramebufferComplete(GLuint fb, GLenum* status = nullptr);
// Does not check completeness.
@ -3508,7 +3541,7 @@ public:
}
bool IsOffscreen() const {
return mIsOffscreen;
return !!mScreen;
}
GLScreenBuffer* Screen() const {
@ -3663,42 +3696,10 @@ protected:
public:
void FlushIfHeavyGLCallsSinceLastFlush();
static bool ShouldSpew();
static bool ShouldDumpExts();
};
bool DoesStringMatch(const char* aString, const char *aWantedString);
void SplitByChar(const nsACString& str, const char delim,
std::vector<nsCString>* const out);
template<size_t N>
bool
MarkBitfieldByString(const nsACString& str, const char* (&markStrList)[N],
std::bitset<N>* const out_markList)
{
for (size_t i = 0; i < N; i++) {
if (str.Equals(markStrList[i])) {
(*out_markList)[i] = 1;
return true;
}
}
return false;
}
template<size_t N>
void
MarkBitfieldByStrings(const std::vector<nsCString>& strList,
bool dumpStrings, const char* (&markStrList)[N],
std::bitset<N>* const out_markList)
{
for (auto itr = strList.begin(); itr != strList.end(); ++itr) {
const nsACString& str = *itr;
const bool wasMarked = MarkBitfieldByString(str, markStrList,
out_markList);
if (dumpStrings)
printf_stderr(" %s%s\n", str.BeginReading(), wasMarked ? "(*)" : "");
}
}
} /* namespace gl */
} /* namespace mozilla */

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

@ -28,8 +28,10 @@ class GLContextCGL : public GLContext
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GLContextCGL, MOZ_OVERRIDE)
GLContextCGL(const SurfaceCaps& caps, NSOpenGLContext* context,
bool isOffscreen, ContextProfile profile);
GLContextCGL(const SurfaceCaps& caps,
GLContext *shareContext,
NSOpenGLContext *context,
bool isOffscreen = false);
~GLContextCGL();

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

@ -274,16 +274,6 @@ static const FeatureInfo sFeatureInfoArr[] = {
* ARB_occlusion_query (added by OpenGL 2.0).
*/
},
{
"get_string_indexed",
GLVersion::GL3,
GLESVersion::ES3,
GLContext::Extension_None,
{
GLContext::Extensions_End
}
// glGetStringi
},
{
"gpu_shader4",
GLVersion::GL3,

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

@ -21,13 +21,15 @@ namespace gl {
using namespace mozilla::gfx;
static bool gUseDoubleBufferedWindows = true;
class CGLLibrary
{
public:
CGLLibrary()
: mInitialized(false)
, mUseDoubleBufferedWindows(true)
, mOGLLibrary(nullptr)
: mInitialized(false),
mOGLLibrary(nullptr),
mPixelFormat(nullptr)
{ }
bool EnsureInitialized()
@ -44,33 +46,48 @@ public:
}
const char* db = PR_GetEnv("MOZ_CGL_DB");
if (db) {
mUseDoubleBufferedWindows = *db != '0';
}
gUseDoubleBufferedWindows = (!db || *db != '0');
mInitialized = true;
return true;
}
bool UseDoubleBufferedWindows() const {
MOZ_ASSERT(mInitialized);
return mUseDoubleBufferedWindows;
NSOpenGLPixelFormat *PixelFormat()
{
if (mPixelFormat == nullptr) {
NSOpenGLPixelFormatAttribute attribs[] = {
NSOpenGLPFAAccelerated,
NSOpenGLPFAAllowOfflineRenderers,
NSOpenGLPFADoubleBuffer,
0
};
if (!gUseDoubleBufferedWindows) {
attribs[2] = 0;
}
mPixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attribs];
}
return mPixelFormat;
}
private:
bool mInitialized;
bool mUseDoubleBufferedWindows;
PRLibrary *mOGLLibrary;
NSOpenGLPixelFormat *mPixelFormat;
};
CGLLibrary sCGLLibrary;
GLContextCGL::GLContextCGL(const SurfaceCaps& caps, NSOpenGLContext* context,
bool isOffscreen, ContextProfile profile)
: GLContext(caps, nullptr, isOffscreen)
, mContext(context)
GLContextCGL::GLContextCGL(
const SurfaceCaps& caps,
GLContext *shareContext,
NSOpenGLContext *context,
bool isOffscreen)
: GLContext(caps, shareContext, isOffscreen),
mContext(context)
{
SetProfileVersion(profile, 210);
SetProfileVersion(ContextProfile::OpenGLCompatibility, 210);
}
GLContextCGL::~GLContextCGL()
@ -145,7 +162,7 @@ GLContextCGL::SetupLookupFunction()
bool
GLContextCGL::IsDoubleBuffered() const
{
return sCGLLibrary.UseDoubleBufferedWindows();
return gUseDoubleBufferedWindows;
}
bool
@ -165,66 +182,26 @@ GLContextCGL::SwapBuffers()
}
static GLContextCGL *
GetGlobalContextCGL()
{
return static_cast<GLContextCGL*>(GLContextProviderCGL::GetGlobalContext());
}
already_AddRefed<GLContext>
GLContextProviderCGL::CreateWrappingExisting(void*, void*)
{
return nullptr;
}
static const NSOpenGLPixelFormatAttribute kAttribs_singleBuffered[] = {
NSOpenGLPFAAccelerated,
NSOpenGLPFAAllowOfflineRenderers,
0
};
static const NSOpenGLPixelFormatAttribute kAttribs_doubleBuffered[] = {
NSOpenGLPFAAccelerated,
NSOpenGLPFAAllowOfflineRenderers,
NSOpenGLPFADoubleBuffer,
0
};
static const NSOpenGLPixelFormatAttribute kAttribs_offscreen[] = {
NSOpenGLPFAPixelBuffer,
0
};
static const NSOpenGLPixelFormatAttribute kAttribs_offscreen_coreProfile[] = {
NSOpenGLPFAAccelerated,
NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core,
0
};
static NSOpenGLContext*
CreateWithFormat(const NSOpenGLPixelFormatAttribute* attribs)
{
NSOpenGLPixelFormat* format = [[NSOpenGLPixelFormat alloc]
initWithAttributes:attribs];
if (!format)
return nullptr;
NSOpenGLContext* context = [[NSOpenGLContext alloc] initWithFormat:format
shareContext:nullptr];
[format release];
return context;
}
already_AddRefed<GLContext>
GLContextProviderCGL::CreateForWindow(nsIWidget *aWidget)
{
if (!sCGLLibrary.EnsureInitialized()) {
return nullptr;
}
GLContextCGL *shareContext = GetGlobalContextCGL();
const NSOpenGLPixelFormatAttribute* attribs;
if (sCGLLibrary.UseDoubleBufferedWindows()) {
attribs = kAttribs_doubleBuffered;
} else {
attribs = kAttribs_singleBuffered;
}
NSOpenGLContext* context = CreateWithFormat(attribs);
NSOpenGLContext *context = [[NSOpenGLContext alloc]
initWithFormat:sCGLLibrary.PixelFormat()
shareContext:(shareContext ? shareContext->mContext : NULL)];
if (!context) {
return nullptr;
}
@ -234,13 +211,10 @@ GLContextProviderCGL::CreateForWindow(nsIWidget *aWidget)
[context setValues:&opaque forParameter:NSOpenGLCPSurfaceOpacity];
SurfaceCaps caps = SurfaceCaps::ForRGBA();
ContextProfile profile = ContextProfile::OpenGLCompatibility;
nsRefPtr<GLContextCGL> glContext = new GLContextCGL(caps, context, false,
profile);
nsRefPtr<GLContextCGL> glContext = new GLContextCGL(caps,
shareContext,
context);
if (!glContext->Init()) {
glContext = nullptr;
[context release];
return nullptr;
}
@ -248,54 +222,49 @@ GLContextProviderCGL::CreateForWindow(nsIWidget *aWidget)
}
static already_AddRefed<GLContextCGL>
CreateOffscreenFBOContext(bool requireCompatProfile)
CreateOffscreenFBOContext(bool aShare = true)
{
if (!sCGLLibrary.EnsureInitialized()) {
return nullptr;
}
ContextProfile profile;
NSOpenGLContext* context = nullptr;
GLContextCGL *shareContext = aShare ? GetGlobalContextCGL() : nullptr;
if (aShare && !shareContext) {
// if there is no share context, then we can't use FBOs.
return nullptr;
}
if (!requireCompatProfile) {
profile = ContextProfile::OpenGLCore;
context = CreateWithFormat(kAttribs_offscreen_coreProfile);
}
if (!context) {
profile = ContextProfile::OpenGLCompatibility;
context = CreateWithFormat(kAttribs_offscreen);
}
NSOpenGLContext *context = [[NSOpenGLContext alloc]
initWithFormat:sCGLLibrary.PixelFormat()
shareContext:shareContext ? shareContext->GetNSOpenGLContext() : NULL];
if (!context) {
return nullptr;
}
SurfaceCaps dummyCaps = SurfaceCaps::Any();
nsRefPtr<GLContextCGL> glContext = new GLContextCGL(dummyCaps, context,
true, profile);
nsRefPtr<GLContextCGL> glContext = new GLContextCGL(dummyCaps, shareContext, context, true);
return glContext.forget();
}
already_AddRefed<GLContext>
GLContextProviderCGL::CreateHeadless(bool requireCompatProfile)
GLContextProviderCGL::CreateHeadless()
{
nsRefPtr<GLContextCGL> gl;
gl = CreateOffscreenFBOContext(requireCompatProfile);
if (!gl)
nsRefPtr<GLContextCGL> glContext = CreateOffscreenFBOContext();
if (!glContext)
return nullptr;
if (!gl->Init())
if (!glContext->Init())
return nullptr;
return gl.forget();
return glContext.forget();
}
already_AddRefed<GLContext>
GLContextProviderCGL::CreateOffscreen(const gfxIntSize& size,
const SurfaceCaps& caps,
bool requireCompatProfile)
const SurfaceCaps& caps)
{
nsRefPtr<GLContext> glContext = CreateHeadless(requireCompatProfile);
nsRefPtr<GLContext> glContext = CreateHeadless();
if (!glContext->InitOffscreen(ToIntSize(size), caps))
return nullptr;

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

@ -878,7 +878,7 @@ GLContextEGL::CreateEGLPixmapOffscreenContext(const gfxIntSize& size)
}
already_AddRefed<GLContext>
GLContextProviderEGL::CreateHeadless(bool)
GLContextProviderEGL::CreateHeadless()
{
if (!sEGLLibrary.EnsureInitialized()) {
return nullptr;
@ -897,10 +897,9 @@ GLContextProviderEGL::CreateHeadless(bool)
// often without the ability to texture from them directly.
already_AddRefed<GLContext>
GLContextProviderEGL::CreateOffscreen(const gfxIntSize& size,
const SurfaceCaps& caps,
bool requireCompatProfile)
const SurfaceCaps& caps)
{
nsRefPtr<GLContext> glContext = CreateHeadless(requireCompatProfile);
nsRefPtr<GLContext> glContext = CreateHeadless();
if (!glContext)
return nullptr;

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

@ -1215,7 +1215,7 @@ DONE_CREATING_PIXMAP:
}
already_AddRefed<GLContext>
GLContextProviderGLX::CreateHeadless(bool)
GLContextProviderGLX::CreateHeadless()
{
gfxIntSize dummySize = gfxIntSize(16, 16);
nsRefPtr<GLContext> glContext = CreateOffscreenPixmapContext(dummySize);
@ -1227,10 +1227,9 @@ GLContextProviderGLX::CreateHeadless(bool)
already_AddRefed<GLContext>
GLContextProviderGLX::CreateOffscreen(const gfxIntSize& size,
const SurfaceCaps& caps,
bool requireCompatProfile)
const SurfaceCaps& caps)
{
nsRefPtr<GLContext> glContext = CreateHeadless(requireCompatProfile);
nsRefPtr<GLContext> glContext = CreateHeadless();
if (!glContext)
return nullptr;

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

@ -58,12 +58,11 @@ public:
*/
static already_AddRefed<GLContext>
CreateOffscreen(const gfxIntSize& size,
const SurfaceCaps& caps,
bool requireCompatProfile);
const SurfaceCaps& caps);
// Just create a context. We'll add offscreen stuff ourselves.
static already_AddRefed<GLContext>
CreateHeadless(bool requireCompatProfile);
CreateHeadless();
/**
* Create wrapping Gecko GLContext for external gl context.

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

@ -22,14 +22,13 @@ GLContextProviderNull::CreateWrappingExisting(void*, void*)
already_AddRefed<GLContext>
GLContextProviderNull::CreateOffscreen(const gfxIntSize&,
const SurfaceCaps&,
bool)
const SurfaceCaps&)
{
return nullptr;
}
already_AddRefed<GLContext>
GLContextProviderNull::CreateHeadless(bool)
GLContextProviderNull::CreateHeadless()
{
return nullptr;
}

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

@ -607,7 +607,7 @@ CreateWindowOffscreenContext()
}
already_AddRefed<GLContext>
GLContextProviderWGL::CreateHeadless(bool)
GLContextProviderWGL::CreateHeadless()
{
if (!sWGLLib.EnsureInitialized()) {
return nullptr;
@ -641,10 +641,9 @@ GLContextProviderWGL::CreateHeadless(bool)
already_AddRefed<GLContext>
GLContextProviderWGL::CreateOffscreen(const gfxIntSize& size,
const SurfaceCaps& caps,
bool requireCompatProfile)
const SurfaceCaps& caps)
{
nsRefPtr<GLContext> glContext = CreateHeadless(requireCompatProfile);
nsRefPtr<GLContext> glContext = CreateHeadless();
if (!glContext)
return nullptr;

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

@ -666,10 +666,6 @@ struct GLContextSymbols
GLsizei width, GLsizei height, GLsizei depth,
GLenum format, GLsizei imageSize, const GLvoid* data);
PFNGLCOMPRESSEDTEXSUBIMAGE3D fCompressedTexSubImage3D;
// get_string_indexed
typedef const GLubyte* (GLAPIENTRY * pfnGLGetStringiT)(GLenum name, GLuint index);
pfnGLGetStringiT fGetStringi;
};
}

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

@ -12,3 +12,8 @@ GLFormats::GLFormats()
{
std::memset(this, 0, sizeof(GLFormats));
}
PixelBufferFormat::PixelBufferFormat()
{
std::memset(this, 0, sizeof(PixelBufferFormat));
}

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

@ -43,6 +43,19 @@ struct GLFormats
GLsizei samples;
};
struct PixelBufferFormat
{
// Constructs a zeroed object:
PixelBufferFormat();
int red, green, blue;
int alpha;
int depth, stencil;
int samples;
int ColorBits() const { return red + green + blue; }
};
} /* namespace gl */
} /* namespace mozilla */

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

@ -35,7 +35,8 @@ static const char *sEGLExtensionNames[] = {
"EGL_EXT_create_context_robustness",
"EGL_KHR_image",
"EGL_KHR_fence_sync",
"EGL_ANDROID_native_fence_sync"
"EGL_ANDROID_native_fence_sync",
nullptr
};
#if defined(ANDROID)
@ -239,8 +240,8 @@ GLLibraryEGL::EnsureInitialized()
};
// Do not warn about the failure to load this - see bug 1092191
GLLibraryLoader::LoadSymbols(mEGLLibrary, &optionalSymbols[0], nullptr, nullptr,
false);
GLLibraryLoader::LoadSymbols(mEGLLibrary, &optionalSymbols[0],
nullptr, nullptr, false);
#if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 18
MOZ_RELEASE_ASSERT(mSymbols.fQueryStringImplementationANDROID,
@ -420,24 +421,15 @@ GLLibraryEGL::EnsureInitialized()
void
GLLibraryEGL::InitExtensions()
{
std::vector<nsCString> driverExtensionList;
const char *extensions = (const char*)fQueryString(mEGLDisplay, LOCAL_EGL_EXTENSIONS);
const char* rawExts = (const char*)fQueryString(mEGLDisplay, LOCAL_EGL_EXTENSIONS);
if (rawExts) {
nsDependentCString exts(rawExts);
SplitByChar(exts, ' ', &driverExtensionList);
} else {
if (!extensions) {
NS_WARNING("Failed to load EGL extension list!");
return;
}
const bool shouldDumpExts = GLContext::ShouldDumpExts();
if (shouldDumpExts) {
printf_stderr("%i EGL driver extensions: (*: recognized)\n",
(uint32_t)driverExtensionList.size());
}
MarkBitfieldByStrings(driverExtensionList, shouldDumpExts, sEGLExtensionNames,
&mAvailableExtensions);
GLContext::InitializeExtensionsBitSet(mAvailableExtensions, extensions,
sEGLExtensionNames);
}
void

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

@ -15,7 +15,6 @@
#include "GeckoProfiler.h"
#include <bitset>
#include <vector>
#if defined(XP_WIN)

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

@ -39,7 +39,7 @@ GLImage::GetAsSourceSurface()
MOZ_ASSERT(NS_IsMainThread(), "Should be on the main thread");
if (!sSnapshotContext) {
sSnapshotContext = GLContextProvider::CreateHeadless(false);
sSnapshotContext = GLContextProvider::CreateHeadless();
if (!sSnapshotContext) {
NS_WARNING("Failed to create snapshot GLContext");
return nullptr;

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

@ -124,11 +124,8 @@ CompositorOGL::CreateContext()
SurfaceCaps caps = SurfaceCaps::ForRGB();
caps.preserve = false;
caps.bpp16 = gfxPlatform::GetPlatform()->GetOffscreenFormat() == gfxImageFormat::RGB16_565;
bool requireCompatProfile = true;
context = GLContextProvider::CreateOffscreen(gfxIntSize(mSurfaceSize.width,
mSurfaceSize.height),
caps, requireCompatProfile);
mSurfaceSize.height), caps);
}
if (!context)

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

@ -45,7 +45,7 @@ public:
caps.preserve = false;
caps.bpp16 = false;
nsRefPtr<GLContext> context = GLContextProvider::CreateOffscreen(
gfxIntSize(gCompWidth, gCompHeight), caps, true);
gfxIntSize(gCompWidth, gCompHeight), caps);
return context.forget().take();
}
return nullptr;

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

@ -1099,9 +1099,8 @@ gfxPlatform::GetSkiaGLGlue()
* FIXME: This should be stored in TLS or something, since there needs to be one for each thread using it. As it
* stands, this only works on the main thread.
*/
bool requireCompatProfile = true;
nsRefPtr<mozilla::gl::GLContext> glContext;
glContext = mozilla::gl::GLContextProvider::CreateHeadless(requireCompatProfile);
mozilla::gl::SurfaceCaps caps = mozilla::gl::SurfaceCaps::ForRGBA();
nsRefPtr<mozilla::gl::GLContext> glContext = mozilla::gl::GLContextProvider::CreateOffscreen(gfxIntSize(16, 16), caps);
if (!glContext) {
printf_stderr("Failed to create GLContext for SkiaGL!\n");
return nullptr;

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

@ -48,6 +48,7 @@ mailing address.
#include "gfxPlatform.h"
#include "qcms.h"
#include <algorithm>
#include "mozilla/Telemetry.h"
namespace mozilla {
namespace image {

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

@ -19,6 +19,7 @@
#include "gfxPlatform.h"
#include "mozilla/Endian.h"
#include "mozilla/Telemetry.h"
extern "C" {
#include "iccjpeg.h"

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

@ -15,6 +15,7 @@
#include "nspr.h"
#include "png.h"
#include "RasterImage.h"
#include "mozilla/Telemetry.h"
#include <algorithm>

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

@ -15,6 +15,7 @@
#include "nsProxyRelease.h"
#include "nsServiceManagerUtils.h"
#include "nsComponentManagerUtils.h"
#include "mozilla/Telemetry.h"
using mozilla::gfx::IntSize;
using mozilla::gfx::SurfaceFormat;
@ -701,5 +702,12 @@ Decoder::NeedNewFrame(uint32_t framenum, uint32_t x_offset, uint32_t y_offset,
mNeedsNewFrame = true;
}
Telemetry::ID
Decoder::SpeedHistogram()
{
// Use HistogramCount as an invalid Histogram ID.
return Telemetry::HistogramCount;
}
} // namespace image
} // namespace mozilla

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

@ -13,10 +13,13 @@
#include "ImageMetadata.h"
#include "Orientation.h"
#include "SourceBuffer.h"
#include "mozilla/Telemetry.h"
namespace mozilla {
namespace Telemetry {
enum ID : uint32_t;
}
namespace image {
class Decoder : public IResumable
@ -263,8 +266,7 @@ public:
return mImageMetadata.GetSize();
}
// Use HistogramCount as an invalid Histogram ID
virtual Telemetry::ID SpeedHistogram() { return Telemetry::HistogramCount; }
virtual Telemetry::ID SpeedHistogram();
ImageMetadata& GetImageMetadata() { return mImageMetadata; }

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

@ -88,9 +88,9 @@ GetDataProperty(JSContext *cx, HandleValue objVal, HandlePropertyName field, Mut
if (IsScriptedProxy(obj))
return LinkFail(cx, "accessing property of a Proxy");
Rooted<JSPropertyDescriptor> desc(cx);
Rooted<PropertyDescriptor> desc(cx);
RootedId id(cx, NameToId(field));
if (!JS_GetPropertyDescriptorById(cx, obj, id, &desc))
if (!GetPropertyDescriptor(cx, obj, id, &desc))
return false;
if (!desc.object())

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

@ -18,6 +18,7 @@
#include "jsobjinlines.h"
#include "vm/NativeObject-inl.h"
#include "vm/Shape-inl.h"
using namespace js;
using namespace js::types;
@ -637,7 +638,7 @@ js::ObjectCreateImpl(JSContext *cx, HandleObject proto, NewObjectKind newKind,
// instead.
RootedObjectGroup ngroup(cx, group);
if (!ngroup) {
ngroup = GetCallerInitGroup(cx, JSProto_Null);
ngroup = ObjectGroup::callingAllocationSiteGroup(cx, JSProto_Null);
if (!ngroup)
return nullptr;
}

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

@ -9,6 +9,8 @@
#include "jsapi.h"
#include "vm/NativeObject.h"
namespace JS {
class CallArgs;
class Value;

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

@ -1495,7 +1495,9 @@ OutlineTypedObject::createUnattachedWithClass(JSContext *cx,
MOZ_ASSERT(clasp == &OutlineTransparentTypedObject::class_ ||
clasp == &OutlineOpaqueTypedObject::class_);
RootedObjectGroup group(cx, cx->getNewGroup(clasp, TaggedProto(&descr->typedProto()), descr));
RootedObjectGroup group(cx, ObjectGroup::defaultNewGroup(cx, clasp,
TaggedProto(&descr->typedProto()),
descr));
if (!group)
return nullptr;
@ -2131,7 +2133,9 @@ InlineTypedObject::create(JSContext *cx, HandleTypeDescr descr, gc::InitialHeap
? &InlineOpaqueTypedObject::class_
: &InlineTransparentTypedObject::class_;
RootedObjectGroup group(cx, cx->getNewGroup(clasp, TaggedProto(&descr->typedProto()), descr));
RootedObjectGroup group(cx, ObjectGroup::defaultNewGroup(cx, clasp,
TaggedProto(&descr->typedProto()),
descr));
if (!group)
return nullptr;

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

@ -4295,7 +4295,7 @@ ParseNode::getConstantValue(ExclusiveContext *cx, AllowConstantObjects allowObje
}
MOZ_ASSERT(idx == count);
types::FixArrayGroup(cx, obj);
ObjectGroup::fixArrayGroup(cx, obj);
vp.setObject(*obj);
return true;
}
@ -4358,7 +4358,7 @@ ParseNode::getConstantValue(ExclusiveContext *cx, AllowConstantObjects allowObje
}
}
types::FixObjectGroup(cx, obj);
ObjectGroup::fixPlainObjectGroup(cx, obj);
vp.setObject(*obj);
return true;
}
@ -7250,13 +7250,13 @@ frontend::EmitTree(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn)
if (!pn->getConstantValue(cx, ParseNode::DontAllowNestedObjects, &value))
return false;
if (!value.isMagic(JS_GENERIC_MAGIC)) {
// Note: the type of the template object might not yet reflect
// Note: the group of the template object might not yet reflect
// that the object has copy on write elements. When the
// interpreter or JIT compiler fetches the template, it should
// use types::GetOrFixupCopyOnWriteObject to make sure the type
// for the template is accurate. We don't do this here as we
// want to use types::InitObject, which requires a finished
// script.
// use ObjectGroup::getOrFixupCopyOnWriteObject to make sure the
// group for the template is accurate. We don't do this here as we
// want to use ObjectGroup::allocationSiteGroup, which requires a
// finished script.
NativeObject *obj = &value.toObject().as<NativeObject>();
if (!ObjectElements::MakeElementsCopyOnWrite(cx, obj))
return false;

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

@ -181,10 +181,7 @@ class ScopeObject;
class ScriptSourceObject;
class Shape;
class UnownedBaseShape;
namespace types {
struct ObjectGroup;
}
class ObjectGroup;
namespace jit {
class JitCode;
@ -232,7 +229,7 @@ template <> struct MapTypeToTraceKind<SharedArrayBufferObject>{ static const JSG
template <> struct MapTypeToTraceKind<SharedTypedArrayObject>{ static const JSGCTraceKind kind = JSTRACE_OBJECT; };
template <> struct MapTypeToTraceKind<UnownedBaseShape> { static const JSGCTraceKind kind = JSTRACE_BASE_SHAPE; };
template <> struct MapTypeToTraceKind<jit::JitCode> { static const JSGCTraceKind kind = JSTRACE_JITCODE; };
template <> struct MapTypeToTraceKind<types::ObjectGroup> { static const JSGCTraceKind kind = JSTRACE_OBJECT_GROUP; };
template <> struct MapTypeToTraceKind<ObjectGroup> { static const JSGCTraceKind kind = JSTRACE_OBJECT_GROUP; };
// Direct value access used by the write barriers and the jits.
void
@ -806,7 +803,7 @@ typedef HeapPtr<PropertyName*> HeapPtrPropertyName;
typedef HeapPtr<Shape*> HeapPtrShape;
typedef HeapPtr<UnownedBaseShape*> HeapPtrUnownedBaseShape;
typedef HeapPtr<jit::JitCode*> HeapPtrJitCode;
typedef HeapPtr<types::ObjectGroup*> HeapPtrObjectGroup;
typedef HeapPtr<ObjectGroup*> HeapPtrObjectGroup;
typedef PreBarriered<Value> PreBarrieredValue;
typedef RelocatablePtr<Value> RelocatableValue;
@ -827,7 +824,7 @@ typedef ReadBarriered<ScriptSourceObject*> ReadBarrieredScriptSourceObject;
typedef ReadBarriered<Shape*> ReadBarrieredShape;
typedef ReadBarriered<UnownedBaseShape*> ReadBarrieredUnownedBaseShape;
typedef ReadBarriered<jit::JitCode*> ReadBarrieredJitCode;
typedef ReadBarriered<types::ObjectGroup*> ReadBarrieredObjectGroup;
typedef ReadBarriered<ObjectGroup*> ReadBarrieredObjectGroup;
typedef ReadBarriered<JSAtom*> ReadBarrieredAtom;
typedef ReadBarriered<JS::Symbol*> ReadBarrieredSymbol;

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

@ -11,7 +11,7 @@
namespace js {
namespace types { struct ObjectGroup; }
class ObjectGroup;
namespace gc {
@ -29,7 +29,7 @@ extern void TraceMinorGCEnd();
extern void TraceMajorGCStart();
extern void TraceTenuredFinalize(Cell *thing);
extern void TraceMajorGCEnd();
extern void TraceTypeNewScript(js::types::ObjectGroup *group);
extern void TraceTypeNewScript(js::ObjectGroup *group);
#else
@ -45,7 +45,7 @@ inline void TraceMinorGCEnd() {}
inline void TraceMajorGCStart() {}
inline void TraceTenuredFinalize(Cell *thing) {}
inline void TraceMajorGCEnd() {}
inline void TraceTypeNewScript(js::types::ObjectGroup *group) {}
inline void TraceTypeNewScript(js::ObjectGroup *group) {}
#endif

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

@ -87,7 +87,7 @@ static inline void
PushMarkStack(GCMarker *gcmarker, JS::Symbol *sym);
static inline void
PushMarkStack(GCMarker *gcmarker, types::ObjectGroup *thing);
PushMarkStack(GCMarker *gcmarker, ObjectGroup *thing);
namespace js {
namespace gc {
@ -98,7 +98,7 @@ static void MarkChildren(JSTracer *trc, JSScript *script);
static void MarkChildren(JSTracer *trc, LazyScript *lazy);
static void MarkChildren(JSTracer *trc, Shape *shape);
static void MarkChildren(JSTracer *trc, BaseShape *base);
static void MarkChildren(JSTracer *trc, types::ObjectGroup *group);
static void MarkChildren(JSTracer *trc, ObjectGroup *group);
static void MarkChildren(JSTracer *trc, jit::JitCode *code);
} /* namespace gc */
@ -614,7 +614,7 @@ DeclMarkerImpl(String, JSFlatString)
DeclMarkerImpl(String, JSLinearString)
DeclMarkerImpl(String, PropertyName)
DeclMarkerImpl(Symbol, JS::Symbol)
DeclMarkerImpl(ObjectGroup, js::types::ObjectGroup)
DeclMarkerImpl(ObjectGroup, js::ObjectGroup)
} /* namespace gc */
} /* namespace js */
@ -655,7 +655,7 @@ gc::MarkKind(JSTracer *trc, void **thingp, JSGCTraceKind kind)
MarkInternal(trc, reinterpret_cast<Shape **>(thingp));
break;
case JSTRACE_OBJECT_GROUP:
MarkInternal(trc, reinterpret_cast<types::ObjectGroup **>(thingp));
MarkInternal(trc, reinterpret_cast<ObjectGroup **>(thingp));
break;
default:
MOZ_CRASH("Invalid trace kind in MarkKind.");
@ -796,7 +796,7 @@ gc::MarkTypeRoot(JSTracer *trc, types::Type *v, const char *name)
MarkInternal(trc, &obj);
*v = types::Type::ObjectType(obj);
} else if (v->isGroup()) {
types::ObjectGroup *group = v->group();
ObjectGroup *group = v->group();
MarkInternal(trc, &group);
*v = types::Type::ObjectType(group);
}
@ -1066,7 +1066,7 @@ PushMarkStack(GCMarker *gcmarker, JSFunction *thing)
}
static void
PushMarkStack(GCMarker *gcmarker, types::ObjectGroup *thing)
PushMarkStack(GCMarker *gcmarker, ObjectGroup *thing)
{
JS_COMPARTMENT_ASSERT(gcmarker->runtime(), thing);
MOZ_ASSERT(!IsInsideNursery(thing));
@ -1422,7 +1422,7 @@ gc::MarkCycleCollectorChildren(JSTracer *trc, Shape *shape)
}
static void
ScanObjectGroup(GCMarker *gcmarker, types::ObjectGroup *group)
ScanObjectGroup(GCMarker *gcmarker, ObjectGroup *group)
{
unsigned count = group->getPropertyCount();
for (unsigned i = 0; i < count; i++) {
@ -1450,7 +1450,7 @@ ScanObjectGroup(GCMarker *gcmarker, types::ObjectGroup *group)
}
static void
gc::MarkChildren(JSTracer *trc, types::ObjectGroup *group)
gc::MarkChildren(JSTracer *trc, ObjectGroup *group)
{
unsigned count = group->getPropertyCount();
for (unsigned i = 0; i < count; i++) {
@ -1533,7 +1533,7 @@ gc::PushArena(GCMarker *gcmarker, ArenaHeader *aheader)
break;
case JSTRACE_OBJECT_GROUP:
PushArenaTyped<js::types::ObjectGroup>(gcmarker, aheader);
PushArenaTyped<js::ObjectGroup>(gcmarker, aheader);
break;
default:
@ -1652,7 +1652,7 @@ void
GCMarker::processMarkStackOther(uintptr_t tag, uintptr_t addr)
{
if (tag == GroupTag) {
ScanObjectGroup(this, reinterpret_cast<types::ObjectGroup *>(addr));
ScanObjectGroup(this, reinterpret_cast<ObjectGroup *>(addr));
} else if (tag == SavedValueArrayTag) {
MOZ_ASSERT(!(addr & CellMask));
NativeObject *obj = reinterpret_cast<NativeObject *>(addr);
@ -1802,7 +1802,7 @@ GCMarker::processMarkStackTop(SliceBudget &budget)
return;
}
types::ObjectGroup *group = obj->groupFromGC();
ObjectGroup *group = obj->groupFromGC();
PushMarkStack(this, group);
Shape *shape = obj->lastProperty();
@ -1957,7 +1957,7 @@ js::TraceChildren(JSTracer *trc, void *thing, JSGCTraceKind kind)
break;
case JSTRACE_OBJECT_GROUP:
MarkChildren(trc, (types::ObjectGroup *)thing);
MarkChildren(trc, (ObjectGroup *)thing);
break;
default:

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

@ -132,7 +132,7 @@ DeclMarker(String, JSFlatString)
DeclMarker(String, JSLinearString)
DeclMarker(String, PropertyName)
DeclMarker(Symbol, JS::Symbol)
DeclMarker(ObjectGroup, types::ObjectGroup)
DeclMarker(ObjectGroup, ObjectGroup)
#undef DeclMarker

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

@ -537,7 +537,7 @@ js::Nursery::forwardBufferPointer(HeapSlot **pSlotsElems)
// been tenured during a minor collection.
struct TenureCount
{
types::ObjectGroup *group;
ObjectGroup *group;
int count;
};
@ -550,8 +550,8 @@ struct Nursery::TenureCountCache
TenureCountCache() { PodZero(this); }
TenureCount &findEntry(types::ObjectGroup *group) {
return entries[PointerHasher<types::ObjectGroup *, 3>::hash(group) % ArrayLength(entries)];
TenureCount &findEntry(ObjectGroup *group) {
return entries[PointerHasher<ObjectGroup *, 3>::hash(group) % ArrayLength(entries)];
}
};

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

@ -31,6 +31,8 @@ class TypedArrayObject;
class ObjectElements;
class NativeObject;
class HeapSlot;
class ObjectGroup;
void SetGCZeal(JSRuntime *, uint8_t, uint32_t);
namespace gc {
@ -39,10 +41,6 @@ class Collector;
class MinorCollectionTracer;
} /* namespace gc */
namespace types {
struct ObjectGroup;
}
namespace jit {
class CodeGenerator;
class MacroAssembler;
@ -117,7 +115,7 @@ class Nursery
/* Free a slots array. */
void freeSlots(HeapSlot *slots);
typedef Vector<types::ObjectGroup *, 0, SystemAllocPolicy> ObjectGroupList;
typedef Vector<ObjectGroup *, 0, SystemAllocPolicy> ObjectGroupList;
/*
* Do a minor collection, optionally specifying a list to store groups which

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

@ -103,7 +103,7 @@ MarkExactStackRootsAcrossTypes(T context, JSTracer *trc)
MarkExactStackRootList<JSObject *, MarkObjectRoot>(trc, context, "exact-object");
MarkExactStackRootList<Shape *, MarkShapeRoot>(trc, context, "exact-shape");
MarkExactStackRootList<BaseShape *, MarkBaseShapeRoot>(trc, context, "exact-baseshape");
MarkExactStackRootList<types::ObjectGroup *, MarkObjectGroupRoot>(
MarkExactStackRootList<ObjectGroup *, MarkObjectGroupRoot>(
trc, context, "exact-objectgroup");
MarkExactStackRootList<JSString *, MarkStringRoot>(trc, context, "exact-string");
MarkExactStackRootList<JS::Symbol *, MarkSymbolRoot>(trc, context, "exact-symbol");

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

@ -20,14 +20,13 @@ class ArrayObject;
class PlainObject;
class ScriptSourceObject;
class Shape;
namespace types { struct ObjectGroup; }
class ObjectGroup;
// These are internal counterparts to the public types such as HandleObject.
typedef JS::Handle<NativeObject*> HandleNativeObject;
typedef JS::Handle<Shape*> HandleShape;
typedef JS::Handle<types::ObjectGroup*> HandleObjectGroup;
typedef JS::Handle<ObjectGroup*> HandleObjectGroup;
typedef JS::Handle<JSAtom*> HandleAtom;
typedef JS::Handle<JSLinearString*> HandleLinearString;
typedef JS::Handle<PropertyName*> HandlePropertyName;
@ -41,7 +40,7 @@ typedef JS::MutableHandle<NativeObject*> MutableHandleNativeObject;
typedef JS::Rooted<NativeObject*> RootedNativeObject;
typedef JS::Rooted<Shape*> RootedShape;
typedef JS::Rooted<types::ObjectGroup*> RootedObjectGroup;
typedef JS::Rooted<ObjectGroup*> RootedObjectGroup;
typedef JS::Rooted<JSAtom*> RootedAtom;
typedef JS::Rooted<JSLinearString*> RootedLinearString;
typedef JS::Rooted<PropertyName*> RootedPropertyName;

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

@ -16,15 +16,13 @@
namespace js {
class NativeObject;
class GCMarker;
class ObjectGroup;
namespace gc {
struct ArenaHeader;
}
namespace jit {
class JitCode;
}
namespace types {
struct ObjectGroup;
}
static const size_t NON_INCREMENTAL_MARK_STACK_BASE_CAPACITY = 4096;
static const size_t INCREMENTAL_MARK_STACK_BASE_CAPACITY = 32768;
@ -143,7 +141,7 @@ class GCMarker : public JSTracer
pushTaggedPtr(ObjectTag, obj);
}
void pushType(types::ObjectGroup *group) {
void pushType(ObjectGroup *group) {
pushTaggedPtr(GroupTag, group);
}

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

@ -34,8 +34,8 @@ class JSObjectPtrOrRef(prettyprinters.Pointer):
def summary(self):
shape = deref(self.value['shape_'])
baseshape = deref(shape['base_'])
otype = deref(self.value['type_'])
class_name = otype['clasp_']['name'].string()
group = deref(self.value['group_'])
class_name = group['clasp_']['name'].string()
flags = baseshape['flags']
is_delegate = bool(flags & self.otc.flag_DELEGATE)
name = None

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

@ -1722,8 +1722,8 @@ BaselineCompiler::emit_JSOP_NEWARRAY()
uint32_t length = GET_UINT24(pc);
RootedObjectGroup group(cx);
if (!types::UseSingletonForInitializer(script, pc, JSProto_Array)) {
group = types::TypeScript::InitGroup(cx, script, pc, JSProto_Array);
if (!ObjectGroup::useSingletonForAllocationSite(script, pc, JSProto_Array)) {
group = ObjectGroup::allocationSiteGroup(cx, script, pc, JSProto_Array);
if (!group)
return false;
}
@ -1753,7 +1753,7 @@ bool
BaselineCompiler::emit_JSOP_NEWARRAY_COPYONWRITE()
{
RootedScript scriptRoot(cx, script);
JSObject *obj = types::GetOrFixupCopyOnWriteObject(cx, scriptRoot, pc);
JSObject *obj = ObjectGroup::getOrFixupCopyOnWriteObject(cx, scriptRoot, pc);
if (!obj)
return false;
@ -1797,8 +1797,8 @@ BaselineCompiler::emit_JSOP_NEWOBJECT()
frame.syncStack(0);
RootedObjectGroup group(cx);
if (!types::UseSingletonForInitializer(script, pc, JSProto_Object)) {
group = types::TypeScript::InitGroup(cx, script, pc, JSProto_Object);
if (!ObjectGroup::useSingletonForAllocationSite(script, pc, JSProto_Object)) {
group = ObjectGroup::allocationSiteGroup(cx, script, pc, JSProto_Object);
if (!group)
return false;
}
@ -1822,8 +1822,8 @@ BaselineCompiler::emit_JSOP_NEWOBJECT()
Register objReg = R0.scratchReg();
Register tempReg = R1.scratchReg();
masm.movePtr(ImmGCPtr(group), tempReg);
masm.branchTest32(Assembler::NonZero, Address(tempReg, types::ObjectGroup::offsetOfFlags()),
Imm32(types::OBJECT_FLAG_PRE_TENURE), &slowPath);
masm.branchTest32(Assembler::NonZero, Address(tempReg, ObjectGroup::offsetOfFlags()),
Imm32(OBJECT_FLAG_PRE_TENURE), &slowPath);
masm.branchPtr(Assembler::NotEqual, AbsoluteAddress(cx->compartment()->addressOfMetadataCallback()),
ImmWord(0), &slowPath);
masm.createGCObject(objReg, tempReg, templateObject, gc::DefaultHeap, &slowPath);
@ -1848,8 +1848,8 @@ BaselineCompiler::emit_JSOP_NEWINIT()
JSProtoKey key = JSProtoKey(GET_UINT8(pc));
RootedObjectGroup group(cx);
if (!types::UseSingletonForInitializer(script, pc, key)) {
group = types::TypeScript::InitGroup(cx, script, pc, key);
if (!ObjectGroup::useSingletonForAllocationSite(script, pc, key)) {
group = ObjectGroup::allocationSiteGroup(cx, script, pc, key);
if (!group)
return false;
}
@ -3364,7 +3364,7 @@ BaselineCompiler::emit_JSOP_REST()
ArrayObject *templateObject = NewDenseUnallocatedArray(cx, 0, nullptr, TenuredObject);
if (!templateObject)
return false;
types::FixRestArgumentsType(cx, templateObject);
ObjectGroup::fixRestArgumentsGroup(cx, templateObject);
// Call IC.
ICRest_Fallback::Compiler compiler(cx, templateObject);

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

@ -2062,7 +2062,7 @@ ICCompare_ObjectWithUndefined::Compiler::generateStubCode(MacroAssembler &masm)
Label emulatesUndefined;
Register obj = masm.extractObject(objectOperand, ExtractTemp0);
masm.loadPtr(Address(obj, JSObject::offsetOfGroup()), obj);
masm.loadPtr(Address(obj, types::ObjectGroup::offsetOfClasp()), obj);
masm.loadPtr(Address(obj, ObjectGroup::offsetOfClasp()), obj);
masm.branchTest32(Assembler::NonZero,
Address(obj, Class::offsetOfFlags()),
Imm32(JSCLASS_EMULATES_UNDEFINED),
@ -4521,7 +4521,7 @@ LoadTypedThingLength(MacroAssembler &masm, TypedThingLayout layout, Register obj
case Layout_OutlineTypedObject:
case Layout_InlineTypedObject:
masm.loadPtr(Address(obj, JSObject::offsetOfGroup()), result);
masm.loadPtr(Address(result, types::ObjectGroup::offsetOfAddendum()), result);
masm.loadPtr(Address(result, ObjectGroup::offsetOfAddendum()), result);
masm.unboxInt32(Address(result, ArrayTypeDescr::offsetOfLength()), result);
break;
default:
@ -8248,13 +8248,10 @@ DoSetPropFallback(JSContext *cx, BaselineFrame *frame, ICSetProp_Fallback *stub_
obj->as<ScopeObject>().setAliasedVar(cx, ScopeCoordinate(pc), name, rhs);
} else {
MOZ_ASSERT(op == JSOP_SETPROP || op == JSOP_STRICTSETPROP);
if (op == JSOP_STRICTSETPROP) {
if (!js::SetProperty<true>(cx, obj, id, rhs))
RootedValue v(cx, rhs);
if (!SetProperty(cx, obj, obj, id, &v, op == JSOP_STRICTSETPROP))
return false;
} else {
if (!js::SetProperty<false>(cx, obj, id, rhs))
return false;
}
}
// Leave the RHS on the stack.
@ -8520,7 +8517,7 @@ ICSetPropNativeAddCompiler::generateStubCode(MacroAssembler &masm)
// Check if the old group still has a newScript.
masm.loadPtr(Address(objReg, JSObject::offsetOfGroup()), scratch);
masm.branchPtr(Assembler::Equal,
Address(scratch, types::ObjectGroup::offsetOfAddendum()),
Address(scratch, ObjectGroup::offsetOfAddendum()),
ImmWord(0),
&noGroupChange);
@ -9049,7 +9046,7 @@ GetTemplateObjectForNative(JSContext *cx, HandleScript script, jsbytecode *pc,
if (!res)
return false;
types::ObjectGroup *group = types::TypeScript::InitGroup(cx, script, pc, JSProto_Array);
ObjectGroup *group = ObjectGroup::allocationSiteGroup(cx, script, pc, JSProto_Array);
if (!group)
return false;
res->setGroup(group);
@ -9061,7 +9058,7 @@ GetTemplateObjectForNative(JSContext *cx, HandleScript script, jsbytecode *pc,
if (!res)
return false;
types::ObjectGroup *group = types::TypeScript::InitGroup(cx, script, pc, JSProto_Array);
ObjectGroup *group = ObjectGroup::allocationSiteGroup(cx, script, pc, JSProto_Array);
if (!group)
return false;
res->setGroup(group);
@ -9085,7 +9082,7 @@ GetTemplateObjectForNative(JSContext *cx, HandleScript script, jsbytecode *pc,
if (!res)
return false;
types::ObjectGroup *group = types::TypeScript::InitGroup(cx, script, pc, JSProto_Array);
ObjectGroup *group = ObjectGroup::allocationSiteGroup(cx, script, pc, JSProto_Array);
if (!group)
return false;
res->setGroup(group);
@ -9487,7 +9484,7 @@ DoCallFallback(JSContext *cx, BaselineFrame *frame, ICCall_Fallback *stub_, uint
// Compute construcing and useNewGroup flags.
bool constructing = (op == JSOP_NEW);
bool createSingleton = types::UseSingletonForNewObject(cx, script, pc);
bool createSingleton = ObjectGroup::useSingletonForNewObject(cx, script, pc);
// Try attaching a call stub.
if (!TryAttachCallStub(cx, stub, script, pc, op, argc, vp, constructing, false, createSingleton))
@ -11609,7 +11606,7 @@ ICSetElem_Dense::ICSetElem_Dense(JitCode *stubCode, HandleShape shape, HandleObj
group_(group)
{ }
ICSetElem_DenseAdd::ICSetElem_DenseAdd(JitCode *stubCode, types::ObjectGroup *group,
ICSetElem_DenseAdd::ICSetElem_DenseAdd(JitCode *stubCode, ObjectGroup *group,
size_t protoChainDepth)
: ICUpdatedStub(SetElem_DenseAdd, stubCode),
group_(group)
@ -12123,7 +12120,7 @@ static bool DoRestFallback(JSContext *cx, ICRest_Fallback *stub,
ArrayObject *obj = NewDenseCopiedArray(cx, numRest, rest, nullptr);
if (!obj)
return false;
types::FixRestArgumentsType(cx, obj);
ObjectGroup::fixRestArgumentsGroup(cx, obj);
res.setObject(*obj);
return true;
}

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

@ -3576,7 +3576,7 @@ class ICSetElem_DenseAdd : public ICUpdatedStub
protected:
HeapPtrObjectGroup group_;
ICSetElem_DenseAdd(JitCode *stubCode, types::ObjectGroup *group, size_t protoChainDepth);
ICSetElem_DenseAdd(JitCode *stubCode, ObjectGroup *group, size_t protoChainDepth);
public:
static size_t offsetOfGroup() {
@ -3611,7 +3611,7 @@ class ICSetElem_DenseAddImpl : public ICSetElem_DenseAdd
static const size_t NumShapes = ProtoChainDepth + 1;
mozilla::Array<HeapPtrShape, NumShapes> shapes_;
ICSetElem_DenseAddImpl(JitCode *stubCode, types::ObjectGroup *group,
ICSetElem_DenseAddImpl(JitCode *stubCode, ObjectGroup *group,
const AutoShapeVector *shapes)
: ICSetElem_DenseAdd(stubCode, group, ProtoChainDepth)
{
@ -3622,7 +3622,7 @@ class ICSetElem_DenseAddImpl : public ICSetElem_DenseAdd
public:
static inline ICSetElem_DenseAddImpl *New(ICStubSpace *space, JitCode *code,
types::ObjectGroup *group,
ObjectGroup *group,
const AutoShapeVector *shapes)
{
if (!code)
@ -4585,7 +4585,7 @@ class ICGetProp_Unboxed : public ICMonitoredStub
public:
Compiler(JSContext *cx, ICStub *firstMonitorStub,
types::ObjectGroup *group, uint32_t fieldOffset, JSValueType fieldType)
ObjectGroup *group, uint32_t fieldOffset, JSValueType fieldType)
: ICStubCompiler(cx, ICStub::GetProp_Unboxed),
firstMonitorStub_(firstMonitorStub),
group_(cx, group),
@ -5545,7 +5545,7 @@ class ICSetProp_Unboxed : public ICUpdatedStub
}
public:
Compiler(JSContext *cx, types::ObjectGroup *group, uint32_t fieldOffset,
Compiler(JSContext *cx, ObjectGroup *group, uint32_t fieldOffset,
JSValueType fieldType)
: ICStubCompiler(cx, ICStub::SetProp_Unboxed),
group_(cx, group),
@ -5635,7 +5635,7 @@ class ICSetProp_TypedObject : public ICUpdatedStub
}
public:
Compiler(JSContext *cx, Shape *shape, types::ObjectGroup *group, uint32_t fieldOffset,
Compiler(JSContext *cx, Shape *shape, ObjectGroup *group, uint32_t fieldOffset,
SimpleTypeDescr *fieldDescr)
: ICStubCompiler(cx, ICStub::SetProp_TypedObject),
shape_(cx, shape),

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

@ -99,7 +99,7 @@ BaselineInspector::maybeInfoForPropertyOp(jsbytecode *pc,
ICStub *stub = entry.firstStub();
while (stub->next()) {
Shape *shape = nullptr;
types::ObjectGroup *group = nullptr;
ObjectGroup *group = nullptr;
if (stub->isGetProp_Native()) {
shape = stub->toGetProp_Native()->shape();
} else if (stub->isSetProp_Native()) {

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

@ -93,7 +93,7 @@ class BaselineInspector
public:
typedef Vector<Shape *, 4, JitAllocPolicy> ShapeVector;
typedef Vector<types::ObjectGroup *, 4, JitAllocPolicy> ObjectGroupVector;
typedef Vector<ObjectGroup *, 4, JitAllocPolicy> ObjectGroupVector;
bool maybeInfoForPropertyOp(jsbytecode *pc,
ShapeVector &nativeShapes,
ObjectGroupVector &unboxedGroups);

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

@ -723,7 +723,7 @@ CodeGenerator::visitFunctionDispatch(LFunctionDispatch *lir)
for (size_t i = 0; i < casesWithFallback - 1; i++) {
MOZ_ASSERT(i < mir->numCases());
LBlock *target = skipTrivialBlocks(mir->getCaseBlock(i))->lir();
if (types::ObjectGroup *funcGroup = mir->getCaseObjectGroup(i)) {
if (ObjectGroup *funcGroup = mir->getCaseObjectGroup(i)) {
masm.branchPtr(Assembler::Equal, Address(input, JSObject::offsetOfGroup()),
ImmGCPtr(funcGroup), target->label());
} else {
@ -764,7 +764,7 @@ CodeGenerator::visitObjectGroupDispatch(LObjectGroupDispatch *lir)
if (lastBranch.isInitialized())
lastBranch.emit(masm);
types::ObjectGroup *group = propTable->getObjectGroup(j);
ObjectGroup *group = propTable->getObjectGroup(j);
lastBranch = MacroAssembler::BranchGCPtr(Assembler::Equal, temp, ImmGCPtr(group),
target->label());
lastBlock = target;
@ -3680,8 +3680,8 @@ CodeGenerator::emitObjectOrStringResultChecks(LInstruction *lir, MDefinition *mi
// properties become unknown, so check for this case.
masm.loadPtr(Address(output, JSObject::offsetOfGroup()), temp);
masm.branchTestPtr(Assembler::NonZero,
Address(temp, types::ObjectGroup::offsetOfFlags()),
Imm32(types::OBJECT_FLAG_UNKNOWN_PROPERTIES), &ok);
Address(temp, ObjectGroup::offsetOfFlags()),
Imm32(OBJECT_FLAG_UNKNOWN_PROPERTIES), &ok);
masm.assumeUnreachable("MIR instruction returned object with unexpected type");
@ -3760,8 +3760,8 @@ CodeGenerator::emitValueResultChecks(LInstruction *lir, MDefinition *mir)
Register payload = masm.extractObject(output, temp1);
masm.loadPtr(Address(payload, JSObject::offsetOfGroup()), temp1);
masm.branchTestPtr(Assembler::NonZero,
Address(temp1, types::ObjectGroup::offsetOfFlags()),
Imm32(types::OBJECT_FLAG_UNKNOWN_PROPERTIES), &ok);
Address(temp1, ObjectGroup::offsetOfFlags()),
Imm32(OBJECT_FLAG_UNKNOWN_PROPERTIES), &ok);
masm.bind(&realMiss);
masm.assumeUnreachable("MIR instruction returned value with unexpected type");
@ -3947,7 +3947,7 @@ CodeGenerator::visitNewArrayCallVM(LNewArray *lir)
saveLive(lir);
JSObject *templateObject = lir->mir()->templateObject();
types::ObjectGroup *group =
ObjectGroup *group =
templateObject->isSingleton() ? nullptr : templateObject->group();
pushArg(Imm32(lir->mir()->allocatingBehaviour()));
@ -4338,7 +4338,7 @@ CodeGenerator::visitSimdUnbox(LSimdUnbox *lir)
// Guard that the object has the same representation as the one produced for
// SIMD value-type.
Address clasp(temp, types::ObjectGroup::offsetOfClasp());
Address clasp(temp, ObjectGroup::offsetOfClasp());
static_assert(!SimdTypeDescr::Opaque, "SIMD objects are transparent");
masm.branchPtr(Assembler::NotEqual, clasp, ImmPtr(&InlineTransparentTypedObject::class_),
&bail);
@ -4346,7 +4346,7 @@ CodeGenerator::visitSimdUnbox(LSimdUnbox *lir)
// obj->type()->typeDescr()
// The previous class pointer comparison implies that the addendumKind is
// Addendum_TypeDescr.
masm.loadPtr(Address(temp, types::ObjectGroup::offsetOfAddendum()), temp);
masm.loadPtr(Address(temp, ObjectGroup::offsetOfAddendum()), temp);
// Check for the /Kind/ reserved slot of the TypeDescr. This is an Int32
// Value which is equivalent to the object class check.
@ -4810,7 +4810,7 @@ CodeGenerator::visitTypedObjectDescr(LTypedObjectDescr *lir)
Register out = ToRegister(lir->output());
masm.loadPtr(Address(obj, JSObject::offsetOfGroup()), out);
masm.loadPtr(Address(out, types::ObjectGroup::offsetOfAddendum()), out);
masm.loadPtr(Address(out, ObjectGroup::offsetOfAddendum()), out);
}
void

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

@ -7,6 +7,7 @@
#ifndef jit_Disassembler_h
#define jit_Disassembler_h
#include "jit/MacroAssembler.h"
#include "jit/Registers.h"
namespace js {

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

@ -2880,7 +2880,7 @@ jit::ConvertLinearInequality(TempAllocator &alloc, MBasicBlock *block, const Lin
}
static bool
AnalyzePoppedThis(JSContext *cx, types::ObjectGroup *group,
AnalyzePoppedThis(JSContext *cx, ObjectGroup *group,
MDefinition *thisValue, MInstruction *ins, bool definitelyExecuted,
HandlePlainObject baseobj,
Vector<types::TypeNewScript::Initializer> *initializerList,
@ -2896,9 +2896,6 @@ AnalyzePoppedThis(JSContext *cx, types::ObjectGroup *group,
if (setprop->object() != thisValue)
return true;
// Don't use GetAtomId here, we need to watch for SETPROP on
// integer properties and bail out. We can't mark the aggregate
// JSID_VOID type property as being in a definite slot.
if (setprop->name() == cx->names().prototype ||
setprop->name() == cx->names().proto ||
setprop->name() == cx->names().constructor)
@ -3016,7 +3013,7 @@ CmpInstructions(const void *a, const void *b)
bool
jit::AnalyzeNewScriptDefiniteProperties(JSContext *cx, JSFunction *fun,
types::ObjectGroup *group, HandlePlainObject baseobj,
ObjectGroup *group, HandlePlainObject baseobj,
Vector<types::TypeNewScript::Initializer> *initializerList)
{
MOZ_ASSERT(cx->zone()->types.activeAnalysis);

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

@ -170,7 +170,7 @@ ConvertLinearInequality(TempAllocator &alloc, MBasicBlock *block, const LinearSu
bool
AnalyzeNewScriptDefiniteProperties(JSContext *cx, JSFunction *fun,
types::ObjectGroup *group, HandlePlainObject baseobj,
ObjectGroup *group, HandlePlainObject baseobj,
Vector<types::TypeNewScript::Initializer> *initializerList);
bool

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

@ -359,7 +359,7 @@ IonBuilder::getPolyCallTargets(types::TemporaryTypeSet *calleeTypes, bool constr
if (obj) {
MOZ_ASSERT(obj->isSingleton());
} else {
types::ObjectGroup *group = calleeTypes->getGroup(i);
ObjectGroup *group = calleeTypes->getGroup(i);
if (!group)
continue;
@ -5322,7 +5322,7 @@ IonBuilder::inlineCalls(CallInfo &callInfo, const ObjectVector &targets,
//
// Note that guarding is on the original function pointer even
// if there is a clone, since cloning occurs at the callsite.
types::ObjectGroup *funcGroup = original->isSingleton() ? nullptr : original->group();
ObjectGroup *funcGroup = original->isSingleton() ? nullptr : original->group();
dispatch->addCase(original, funcGroup, inlineBlock);
MDefinition *retVal = inlineReturnBlock->peek(-1);
@ -5543,7 +5543,7 @@ IonBuilder::createThisScriptedSingleton(JSFunction *target, MDefinition *callee)
return nullptr;
types::TypeSetObjectKey *templateObjectKey = types::TypeSetObjectKey::get(templateObject->group());
if (templateObjectKey->hasFlags(constraints(), types::OBJECT_FLAG_NEW_SCRIPT_CLEARED))
if (templateObjectKey->hasFlags(constraints(), OBJECT_FLAG_NEW_SCRIPT_CLEARED))
return nullptr;
types::StackTypeSet *thisTypes = types::TypeScript::ThisTypes(target->nonLazyScript());
@ -6250,14 +6250,14 @@ IonBuilder::jsop_newarray(uint32_t count)
bool
IonBuilder::jsop_newarray_copyonwrite()
{
ArrayObject *templateObject = types::GetCopyOnWriteObject(script(), pc);
ArrayObject *templateObject = ObjectGroup::getCopyOnWriteObject(script(), pc);
// The baseline compiler should have ensured the template object has a type
// with the copy on write flag set already. During the arguments usage
// analysis the baseline compiler hasn't run yet, however, though in this
// case the template object's type doesn't matter.
MOZ_ASSERT_IF(info().analysisMode() != Analysis_ArgumentsUsage,
templateObject->group()->hasAnyFlags(types::OBJECT_FLAG_COPY_ON_WRITE));
templateObject->group()->hasAnyFlags(OBJECT_FLAG_COPY_ON_WRITE));
MNewArrayCopyOnWrite *ins =
MNewArrayCopyOnWrite::New(alloc(), constraints(), templateObject,
@ -6326,7 +6326,7 @@ IonBuilder::jsop_initelem_array()
} else {
types::TypeSetObjectKey *initializer = obj->resultTypeSet()->getObject(0);
if (value->type() == MIRType_MagicHole) {
if (!initializer->hasFlags(constraints(), types::OBJECT_FLAG_NON_PACKED))
if (!initializer->hasFlags(constraints(), OBJECT_FLAG_NON_PACKED))
needStub = true;
} else if (!initializer->unknownProperties()) {
types::HeapTypeSetKey elemTypes = initializer->property(JSID_VOID);
@ -7629,7 +7629,7 @@ IonBuilder::checkTypedObjectIndexInBounds(int32_t elemSize,
// If we are not loading the length from the object itself, only
// optimize if the array buffer can't have been neutered.
types::TypeSetObjectKey *globalKey = types::TypeSetObjectKey::get(&script()->global());
if (globalKey->hasFlags(constraints(), types::OBJECT_FLAG_TYPED_OBJECT_NEUTERED)) {
if (globalKey->hasFlags(constraints(), OBJECT_FLAG_TYPED_OBJECT_NEUTERED)) {
trackOptimizationOutcome(TrackedOutcome::TypedObjectNeutered);
return false;
}
@ -9082,7 +9082,7 @@ IonBuilder::jsop_length_fastPath()
// Compute the length for array objects.
if (objTypes &&
objTypes->getKnownClass(constraints()) == &ArrayObject::class_ &&
!objTypes->hasObjectFlags(constraints(), types::OBJECT_FLAG_LENGTH_OVERFLOW))
!objTypes->hasObjectFlags(constraints(), OBJECT_FLAG_LENGTH_OVERFLOW))
{
current->pop();
MElements *elements = MElements::New(alloc(), obj);
@ -9099,7 +9099,7 @@ IonBuilder::jsop_length_fastPath()
TypedObjectPrediction prediction = typedObjectPrediction(obj);
if (!prediction.isUseless()) {
types::TypeSetObjectKey *globalKey = types::TypeSetObjectKey::get(&script()->global());
if (globalKey->hasFlags(constraints(), types::OBJECT_FLAG_TYPED_OBJECT_NEUTERED))
if (globalKey->hasFlags(constraints(), OBJECT_FLAG_TYPED_OBJECT_NEUTERED))
return false;
MInstruction *length;
@ -9230,7 +9230,7 @@ IonBuilder::getDefiniteSlot(types::TemporaryTypeSet *types, PropertyName *name)
if (!key)
continue;
if (types::ObjectGroup *group = key->maybeGroup()) {
if (ObjectGroup *group = key->maybeGroup()) {
if (group->newScript() && !group->newScript()->analyzed()) {
addAbortedNewScriptPropertiesGroup(group);
trackOptimizationOutcome(TrackedOutcome::NoAnalysisInfo);
@ -9538,7 +9538,7 @@ IonBuilder::annotateGetPropertyCache(MDefinition *obj, MGetPropertyCache *getPro
// Ensure that the relevant property typeset for each group is
// is a single-object typeset containing a JSFunction
for (unsigned int i = 0; i < objCount; i++) {
types::ObjectGroup *group = objTypes->getGroup(i);
ObjectGroup *group = objTypes->getGroup(i);
if (!group)
continue;
types::TypeSetObjectKey *key = types::TypeSetObjectKey::get(group);
@ -9988,7 +9988,7 @@ IonBuilder::getPropTryScalarPropOfTypedObject(bool *emitted, MDefinition *typedO
// Don't optimize if the typed object might be neutered.
types::TypeSetObjectKey *globalKey = types::TypeSetObjectKey::get(&script()->global());
if (globalKey->hasFlags(constraints(), types::OBJECT_FLAG_TYPED_OBJECT_NEUTERED))
if (globalKey->hasFlags(constraints(), OBJECT_FLAG_TYPED_OBJECT_NEUTERED))
return true;
trackOptimizationSuccess();
@ -10010,7 +10010,7 @@ IonBuilder::getPropTryReferencePropOfTypedObject(bool *emitted, MDefinition *typ
ReferenceTypeDescr::Type fieldType = fieldPrediction.referenceType();
types::TypeSetObjectKey *globalKey = types::TypeSetObjectKey::get(&script()->global());
if (globalKey->hasFlags(constraints(), types::OBJECT_FLAG_TYPED_OBJECT_NEUTERED))
if (globalKey->hasFlags(constraints(), OBJECT_FLAG_TYPED_OBJECT_NEUTERED))
return true;
trackOptimizationSuccess();
@ -10032,7 +10032,7 @@ IonBuilder::getPropTryComplexPropOfTypedObject(bool *emitted,
{
// Don't optimize if the typed object might be neutered.
types::TypeSetObjectKey *globalKey = types::TypeSetObjectKey::get(&script()->global());
if (globalKey->hasFlags(constraints(), types::OBJECT_FLAG_TYPED_OBJECT_NEUTERED))
if (globalKey->hasFlags(constraints(), OBJECT_FLAG_TYPED_OBJECT_NEUTERED))
return true;
// OK, perform the optimization
@ -10430,7 +10430,7 @@ IonBuilder::getPropTryInlineAccess(bool *emitted, MDefinition *obj, PropertyName
if (nativeShapes.empty() && unboxedGroups.length() == 1) {
spew("Inlining monomorphic unboxed GETPROP");
types::ObjectGroup *group = unboxedGroups[0];
ObjectGroup *group = unboxedGroups[0];
// Failures in this group guard should be treated the same as a shape guard failure.
obj = MGuardObjectGroup::New(alloc(), obj, group, /* bailOnEquality = */ false,
@ -10604,7 +10604,7 @@ IonBuilder::tryInnerizeWindow(MDefinition *obj)
// its ObjectGroup as having unknown properties. The type constraint we add
// here will invalidate JIT code when this happens.
types::TypeSetObjectKey *key = types::TypeSetObjectKey::get(singleton);
if (key->hasFlags(constraints(), types::OBJECT_FLAG_UNKNOWN_PROPERTIES))
if (key->hasFlags(constraints(), OBJECT_FLAG_UNKNOWN_PROPERTIES))
return obj;
obj->setImplicitlyUsedUnchecked();
@ -10883,7 +10883,7 @@ IonBuilder::setPropTryReferencePropOfTypedObject(bool *emitted,
ReferenceTypeDescr::Type fieldType = fieldPrediction.referenceType();
types::TypeSetObjectKey *globalKey = types::TypeSetObjectKey::get(&script()->global());
if (globalKey->hasFlags(constraints(), types::OBJECT_FLAG_TYPED_OBJECT_NEUTERED))
if (globalKey->hasFlags(constraints(), OBJECT_FLAG_TYPED_OBJECT_NEUTERED))
return true;
LinearSum byteOffset(alloc());
@ -10912,7 +10912,7 @@ IonBuilder::setPropTryScalarPropOfTypedObject(bool *emitted,
// Don't optimize if the typed object might be neutered.
types::TypeSetObjectKey *globalKey = types::TypeSetObjectKey::get(&script()->global());
if (globalKey->hasFlags(constraints(), types::OBJECT_FLAG_TYPED_OBJECT_NEUTERED))
if (globalKey->hasFlags(constraints(), OBJECT_FLAG_TYPED_OBJECT_NEUTERED))
return true;
LinearSum byteOffset(alloc());
@ -11109,7 +11109,7 @@ IonBuilder::setPropTryInlineAccess(bool *emitted, MDefinition *obj,
if (nativeShapes.empty() && unboxedGroups.length() == 1) {
spew("Inlining monomorphic unboxed SETPROP");
types::ObjectGroup *group = unboxedGroups[0];
ObjectGroup *group = unboxedGroups[0];
// Failures in this group guard should be treated the same as a shape guard failure.
obj = MGuardObjectGroup::New(alloc(), obj, group, /* bailOnEquality = */ false,
@ -11244,7 +11244,7 @@ IonBuilder::jsop_regexp(RegExpObject *reobj)
bool mustClone = true;
types::TypeSetObjectKey *globalKey = types::TypeSetObjectKey::get(&script()->global());
if (!globalKey->hasFlags(constraints(), types::OBJECT_FLAG_REGEXP_FLAGS_SET)) {
if (!globalKey->hasFlags(constraints(), OBJECT_FLAG_REGEXP_FLAGS_SET)) {
#ifdef DEBUG
// Only compare the statics if the one on script()->global() has been
// instantiated.
@ -11633,7 +11633,7 @@ IonBuilder::hasStaticScopeObject(ScopeCoordinate sc, JSObject **pcall)
types::TypeSetObjectKey *funKey =
types::TypeSetObjectKey::get(outerScript->functionNonDelazifying());
if (funKey->hasFlags(constraints(), types::OBJECT_FLAG_RUNONCE_INVALIDATED))
if (funKey->hasFlags(constraints(), OBJECT_FLAG_RUNONCE_INVALIDATED))
return false;
// The script this aliased var operation is accessing will run only once,
@ -12103,7 +12103,7 @@ IonBuilder::typedObjectPrediction(types::TemporaryTypeSet *types)
TypedObjectPrediction out;
for (uint32_t i = 0; i < types->getObjectCount(); i++) {
types::ObjectGroup *group = types->getGroup(i);
ObjectGroup *group = types->getGroup(i);
if (!group || !types::TypeSetObjectKey::get(group)->hasStableClassAndProto(constraints()))
return TypedObjectPrediction();

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

@ -488,7 +488,7 @@ GeneratePrototypeGuards(JSContext *cx, IonScript *ion, MacroAssembler &masm, JSO
// Note: objectReg and scratchReg may be the same register, so we cannot
// use objectReg in the rest of this function.
masm.loadPtr(Address(objectReg, JSObject::offsetOfGroup()), scratchReg);
Address proto(scratchReg, types::ObjectGroup::offsetOfProto());
Address proto(scratchReg, ObjectGroup::offsetOfProto());
masm.branchPtr(Assembler::NotEqual, proto,
ImmMaybeNurseryPtr(obj->getProto()), failures);
}
@ -1897,7 +1897,7 @@ CheckTypeSetForWrite(MacroAssembler &masm, JSObject *obj, jsid id,
Register object, ConstantOrRegister value, Label *failure)
{
TypedOrValueRegister valReg = value.reg();
types::ObjectGroup *group = obj->group();
ObjectGroup *group = obj->group();
if (group->unknownProperties())
return;
types::HeapTypeSet *propTypes = group->maybeGetProperty(id);
@ -1929,7 +1929,7 @@ GenerateSetSlot(JSContext *cx, MacroAssembler &masm, IonCache::StubAttacher &att
// just guard that it's already there.
// Obtain and guard on the ObjectGroup of the object.
types::ObjectGroup *group = obj->group();
ObjectGroup *group = obj->group();
masm.branchPtr(Assembler::NotEqual,
Address(object, JSObject::offsetOfGroup()),
ImmGCPtr(group), &failures);
@ -2463,7 +2463,7 @@ SetPropertyIC::attachCallSetter(JSContext *cx, HandleScript outerScript, IonScri
static void
GenerateAddSlot(JSContext *cx, MacroAssembler &masm, IonCache::StubAttacher &attacher,
NativeObject *obj, Shape *oldShape, types::ObjectGroup *oldGroup,
NativeObject *obj, Shape *oldShape, ObjectGroup *oldGroup,
Register object, ConstantOrRegister value,
bool checkTypeset)
{
@ -2520,7 +2520,7 @@ GenerateAddSlot(JSContext *cx, MacroAssembler &masm, IonCache::StubAttacher &att
masm.push(object);
masm.loadPtr(Address(object, JSObject::offsetOfGroup()), object);
masm.branchPtr(Assembler::Equal,
Address(object, types::ObjectGroup::offsetOfAddendum()),
Address(object, ObjectGroup::offsetOfAddendum()),
ImmWord(0),
&noTypeChange);
masm.pop(object);
@ -2579,7 +2579,7 @@ static bool
CanInlineSetPropTypeCheck(JSObject *obj, jsid id, ConstantOrRegister val, bool *checkTypeset)
{
bool shouldCheck = false;
types::ObjectGroup *group = obj->group();
ObjectGroup *group = obj->group();
if (!group->unknownProperties()) {
types::HeapTypeSet *propTypes = group->maybeGetProperty(id);
if (!propTypes)

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

@ -506,10 +506,10 @@ IonBuilder::inlineArrayPopShift(CallInfo &callInfo, MArrayPopShift::Mode mode)
// Pop and shift are only handled for dense arrays that have never been
// used in an iterator: popping elements does not account for suppressing
// deleted properties in active iterators.
types::ObjectGroupFlags unhandledFlags =
types::OBJECT_FLAG_SPARSE_INDEXES |
types::OBJECT_FLAG_LENGTH_OVERFLOW |
types::OBJECT_FLAG_ITERATED;
ObjectGroupFlags unhandledFlags =
OBJECT_FLAG_SPARSE_INDEXES |
OBJECT_FLAG_LENGTH_OVERFLOW |
OBJECT_FLAG_ITERATED;
MDefinition *obj = callInfo.thisArg();
types::TemporaryTypeSet *thisTypes = obj->resultTypeSet();
@ -530,7 +530,7 @@ IonBuilder::inlineArrayPopShift(CallInfo &callInfo, MArrayPopShift::Mode mode)
obj = addMaybeCopyElementsForWrite(obj);
types::TemporaryTypeSet *returnTypes = getInlineReturnTypeSet();
bool needsHoleCheck = thisTypes->hasObjectFlags(constraints(), types::OBJECT_FLAG_NON_PACKED);
bool needsHoleCheck = thisTypes->hasObjectFlags(constraints(), OBJECT_FLAG_NON_PACKED);
bool maybeUndefined = returnTypes->hasType(types::Type::UndefinedType());
BarrierKind barrier = PropertyReadNeedsTypeBarrier(analysisContext, constraints(),
@ -643,8 +643,8 @@ IonBuilder::inlineArrayPush(CallInfo &callInfo)
types::TemporaryTypeSet *thisTypes = callInfo.thisArg()->resultTypeSet();
if (!thisTypes || thisTypes->getKnownClass(constraints()) != &ArrayObject::class_)
return InliningStatus_NotInlined;
if (thisTypes->hasObjectFlags(constraints(), types::OBJECT_FLAG_SPARSE_INDEXES |
types::OBJECT_FLAG_LENGTH_OVERFLOW))
if (thisTypes->hasObjectFlags(constraints(), OBJECT_FLAG_SPARSE_INDEXES |
OBJECT_FLAG_LENGTH_OVERFLOW))
{
trackOptimizationOutcome(TrackedOutcome::ArrayBadFlags);
return InliningStatus_NotInlined;
@ -711,8 +711,8 @@ IonBuilder::inlineArrayConcat(CallInfo &callInfo)
if (thisTypes->getKnownClass(constraints()) != &ArrayObject::class_)
return InliningStatus_NotInlined;
if (thisTypes->hasObjectFlags(constraints(), types::OBJECT_FLAG_SPARSE_INDEXES |
types::OBJECT_FLAG_LENGTH_OVERFLOW))
if (thisTypes->hasObjectFlags(constraints(), OBJECT_FLAG_SPARSE_INDEXES |
OBJECT_FLAG_LENGTH_OVERFLOW))
{
trackOptimizationOutcome(TrackedOutcome::ArrayBadFlags);
return InliningStatus_NotInlined;
@ -720,8 +720,8 @@ IonBuilder::inlineArrayConcat(CallInfo &callInfo)
if (argTypes->getKnownClass(constraints()) != &ArrayObject::class_)
return InliningStatus_NotInlined;
if (argTypes->hasObjectFlags(constraints(), types::OBJECT_FLAG_SPARSE_INDEXES |
types::OBJECT_FLAG_LENGTH_OVERFLOW))
if (argTypes->hasObjectFlags(constraints(), OBJECT_FLAG_SPARSE_INDEXES |
OBJECT_FLAG_LENGTH_OVERFLOW))
{
trackOptimizationOutcome(TrackedOutcome::ArrayBadFlags);
return InliningStatus_NotInlined;
@ -738,7 +738,7 @@ IonBuilder::inlineArrayConcat(CallInfo &callInfo)
if (thisTypes->getObjectCount() != 1)
return InliningStatus_NotInlined;
types::ObjectGroup *thisGroup = thisTypes->getGroup(0);
ObjectGroup *thisGroup = thisTypes->getGroup(0);
if (!thisGroup)
return InliningStatus_NotInlined;
types::TypeSetObjectKey *thisKey = types::TypeSetObjectKey::get(thisGroup);
@ -747,8 +747,8 @@ IonBuilder::inlineArrayConcat(CallInfo &callInfo)
// Don't inline if 'this' is packed and the argument may not be packed
// (the result array will reuse the 'this' type).
if (!thisTypes->hasObjectFlags(constraints(), types::OBJECT_FLAG_NON_PACKED) &&
argTypes->hasObjectFlags(constraints(), types::OBJECT_FLAG_NON_PACKED))
if (!thisTypes->hasObjectFlags(constraints(), OBJECT_FLAG_NON_PACKED) &&
argTypes->hasObjectFlags(constraints(), OBJECT_FLAG_NON_PACKED))
{
trackOptimizationOutcome(TrackedOutcome::ArrayBadFlags);
return InliningStatus_NotInlined;

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

@ -4321,14 +4321,14 @@ bool
jit::ElementAccessIsPacked(types::CompilerConstraintList *constraints, MDefinition *obj)
{
types::TemporaryTypeSet *types = obj->resultTypeSet();
return types && !types->hasObjectFlags(constraints, types::OBJECT_FLAG_NON_PACKED);
return types && !types->hasObjectFlags(constraints, OBJECT_FLAG_NON_PACKED);
}
bool
jit::ElementAccessMightBeCopyOnWrite(types::CompilerConstraintList *constraints, MDefinition *obj)
{
types::TemporaryTypeSet *types = obj->resultTypeSet();
return !types || types->hasObjectFlags(constraints, types::OBJECT_FLAG_COPY_ON_WRITE);
return !types || types->hasObjectFlags(constraints, OBJECT_FLAG_COPY_ON_WRITE);
}
bool
@ -4337,7 +4337,7 @@ jit::ElementAccessHasExtraIndexedProperty(types::CompilerConstraintList *constra
{
types::TemporaryTypeSet *types = obj->resultTypeSet();
if (!types || types->hasObjectFlags(constraints, types::OBJECT_FLAG_LENGTH_OVERFLOW))
if (!types || types->hasObjectFlags(constraints, OBJECT_FLAG_LENGTH_OVERFLOW))
return true;
return types::TypeCanHaveExtraIndexedProperties(constraints, types);

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

@ -6319,7 +6319,7 @@ class MStringSplit
JSObject *templateObject() const {
return &getOperand(2)->toConstant()->value().toObject();
}
types::ObjectGroup *group() const {
ObjectGroup *group() const {
return templateObject()->group();
}
bool possiblyCalls() const MOZ_OVERRIDE {
@ -7166,7 +7166,7 @@ struct LambdaFunctionInfo
? (gc::Cell *) fun->nonLazyScript()
: (gc::Cell *) fun->lazyScript()),
singletonType(fun->isSingleton()),
useSingletonForClone(types::UseSingletonForClone(fun))
useSingletonForClone(ObjectGroup::useSingletonForClone(fun))
{}
LambdaFunctionInfo(const LambdaFunctionInfo &info)
@ -7187,7 +7187,7 @@ class MLambda
: MBinaryInstruction(scopeChain, cst), info_(&cst->value().toObject().as<JSFunction>())
{
setResultType(MIRType_Object);
if (!info().fun->isSingleton() && !types::UseSingletonForClone(info().fun))
if (!info().fun->isSingleton() && !ObjectGroup::useSingletonForClone(info().fun))
setResultTypeSet(MakeSingletonTypeSet(constraints, info().fun));
}
@ -7225,7 +7225,7 @@ class MLambdaArrow
: MBinaryInstruction(scopeChain, this_), info_(fun)
{
setResultType(MIRType_Object);
MOZ_ASSERT(!types::UseSingletonForClone(fun));
MOZ_ASSERT(!ObjectGroup::useSingletonForClone(fun));
if (!fun->isSingleton())
setResultTypeSet(MakeSingletonTypeSet(constraints, fun));
}
@ -9201,10 +9201,10 @@ typedef Vector<bool, 4, JitAllocPolicy> BoolVector;
class InlinePropertyTable : public TempObject
{
struct Entry : public TempObject {
AlwaysTenured<types::ObjectGroup *> group;
AlwaysTenured<ObjectGroup *> group;
AlwaysTenuredFunction func;
Entry(types::ObjectGroup *group, JSFunction *func)
Entry(ObjectGroup *group, JSFunction *func)
: group(group), func(func)
{ }
};
@ -9232,7 +9232,7 @@ class InlinePropertyTable : public TempObject
return pc_;
}
bool addEntry(TempAllocator &alloc, types::ObjectGroup *group, JSFunction *func) {
bool addEntry(TempAllocator &alloc, ObjectGroup *group, JSFunction *func) {
return entries_.append(new(alloc) Entry(group, func));
}
@ -9240,7 +9240,7 @@ class InlinePropertyTable : public TempObject
return entries_.length();
}
types::ObjectGroup *getObjectGroup(size_t i) const {
ObjectGroup *getObjectGroup(size_t i) const {
MOZ_ASSERT(i < numEntries());
return entries_[i]->group;
}
@ -9380,7 +9380,7 @@ class MGetPropertyPolymorphic
};
Vector<Entry, 4, JitAllocPolicy> nativeShapes_;
Vector<types::ObjectGroup *, 4, JitAllocPolicy> unboxedGroups_;
Vector<ObjectGroup *, 4, JitAllocPolicy> unboxedGroups_;
AlwaysTenuredPropertyName name_;
MGetPropertyPolymorphic(TempAllocator &alloc, MDefinition *obj, PropertyName *name)
@ -9415,7 +9415,7 @@ class MGetPropertyPolymorphic
entry.shape = shape;
return nativeShapes_.append(entry);
}
bool addUnboxedGroup(types::ObjectGroup *group) {
bool addUnboxedGroup(ObjectGroup *group) {
return unboxedGroups_.append(group);
}
size_t numShapes() const {
@ -9430,7 +9430,7 @@ class MGetPropertyPolymorphic
size_t numUnboxedGroups() const {
return unboxedGroups_.length();
}
types::ObjectGroup *unboxedGroup(size_t i) const {
ObjectGroup *unboxedGroup(size_t i) const {
return unboxedGroups_[i];
}
PropertyName *name() const {
@ -9462,7 +9462,7 @@ class MSetPropertyPolymorphic
};
Vector<Entry, 4, JitAllocPolicy> nativeShapes_;
Vector<types::ObjectGroup *, 4, JitAllocPolicy> unboxedGroups_;
Vector<ObjectGroup *, 4, JitAllocPolicy> unboxedGroups_;
AlwaysTenuredPropertyName name_;
bool needsBarrier_;
@ -9490,7 +9490,7 @@ class MSetPropertyPolymorphic
entry.shape = shape;
return nativeShapes_.append(entry);
}
bool addUnboxedGroup(types::ObjectGroup *group) {
bool addUnboxedGroup(ObjectGroup *group) {
return unboxedGroups_.append(group);
}
size_t numShapes() const {
@ -9505,7 +9505,7 @@ class MSetPropertyPolymorphic
size_t numUnboxedGroups() const {
return unboxedGroups_.length();
}
types::ObjectGroup *unboxedGroup(size_t i) const {
ObjectGroup *unboxedGroup(size_t i) const {
return unboxedGroups_[i];
}
PropertyName *name() const {
@ -9539,10 +9539,10 @@ class MDispatchInstruction
// If |func| has a singleton group, |funcGroup| is null. Otherwise,
// |funcGroup| holds the ObjectGroup for |func|, and dispatch guards
// on the group instead of directly on the function.
types::ObjectGroup *funcGroup;
ObjectGroup *funcGroup;
MBasicBlock *block;
Entry(JSFunction *func, types::ObjectGroup *funcGroup, MBasicBlock *block)
Entry(JSFunction *func, ObjectGroup *funcGroup, MBasicBlock *block)
: func(func), funcGroup(funcGroup), block(block)
{ }
};
@ -9611,7 +9611,7 @@ class MDispatchInstruction
}
public:
void addCase(JSFunction *func, types::ObjectGroup *funcGroup, MBasicBlock *block) {
void addCase(JSFunction *func, ObjectGroup *funcGroup, MBasicBlock *block) {
map_.append(Entry(func, funcGroup, block));
}
uint32_t numCases() const {
@ -9620,7 +9620,7 @@ class MDispatchInstruction
JSFunction *getCase(uint32_t i) const {
return map_[i].func;
}
types::ObjectGroup *getCaseObjectGroup(uint32_t i) const {
ObjectGroup *getCaseObjectGroup(uint32_t i) const {
return map_[i].funcGroup;
}
MBasicBlock *getCaseBlock(uint32_t i) const {
@ -9858,11 +9858,11 @@ class MGuardObjectGroup
: public MUnaryInstruction,
public SingleObjectPolicy::Data
{
AlwaysTenured<types::ObjectGroup *> group_;
AlwaysTenured<ObjectGroup *> group_;
bool bailOnEquality_;
BailoutKind bailoutKind_;
MGuardObjectGroup(MDefinition *obj, types::ObjectGroup *group, bool bailOnEquality,
MGuardObjectGroup(MDefinition *obj, ObjectGroup *group, bool bailOnEquality,
BailoutKind bailoutKind)
: MUnaryInstruction(obj),
group_(group),
@ -9877,7 +9877,7 @@ class MGuardObjectGroup
public:
INSTRUCTION_HEADER(GuardObjectGroup)
static MGuardObjectGroup *New(TempAllocator &alloc, MDefinition *obj, types::ObjectGroup *group,
static MGuardObjectGroup *New(TempAllocator &alloc, MDefinition *obj, ObjectGroup *group,
bool bailOnEquality, BailoutKind bailoutKind) {
return new(alloc) MGuardObjectGroup(obj, group, bailOnEquality, bailoutKind);
}
@ -9885,7 +9885,7 @@ class MGuardObjectGroup
MDefinition *obj() const {
return getOperand(0);
}
const types::ObjectGroup *group() const {
const ObjectGroup *group() const {
return group_;
}
bool bailOnEquality() const {

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

@ -154,7 +154,7 @@ class MIRGenerator
return modifiesFrameArguments_;
}
typedef Vector<types::ObjectGroup *, 0, JitAllocPolicy> ObjectGroupVector;
typedef Vector<ObjectGroup *, 0, JitAllocPolicy> ObjectGroupVector;
// When abortReason() == AbortReason_NewScriptProperties, all types which
// the new script properties analysis hasn't been performed on yet.
@ -199,7 +199,7 @@ class MIRGenerator
// CodeGenerator::link).
ObjectVector nurseryObjects_;
void addAbortedNewScriptPropertiesGroup(types::ObjectGroup *type);
void addAbortedNewScriptPropertiesGroup(ObjectGroup *type);
void setForceAbort() {
shouldForceAbort_ = true;
}

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

@ -93,7 +93,7 @@ MIRGenerator::abort(const char *message, ...)
}
void
MIRGenerator::addAbortedNewScriptPropertiesGroup(types::ObjectGroup *group)
MIRGenerator::addAbortedNewScriptPropertiesGroup(ObjectGroup *group)
{
for (size_t i = 0; i < abortedNewScriptPropertiesGroups_.length(); i++) {
if (group == abortedNewScriptPropertiesGroups_[i])

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

@ -60,7 +60,7 @@ class TypeWrapper {
return t_.singletonNoBarrier();
return nullptr;
}
inline types::ObjectGroup *getGroupNoBarrier(unsigned) const {
inline ObjectGroup *getGroupNoBarrier(unsigned) const {
if (t_.isGroup())
return t_.groupNoBarrier();
return nullptr;
@ -146,8 +146,8 @@ MacroAssembler::guardTypeSet(const Source &address, const TypeSet *types, Barrie
extractObject(address, scratch);
loadPtr(Address(obj, JSObject::offsetOfGroup()), scratch);
branchTestPtr(Assembler::NonZero,
Address(scratch, types::ObjectGroup::offsetOfFlags()),
Imm32(types::OBJECT_FLAG_UNKNOWN_PROPERTIES), &matched);
Address(scratch, ObjectGroup::offsetOfFlags()),
Imm32(OBJECT_FLAG_UNKNOWN_PROPERTIES), &matched);
assumeUnreachable("Unexpected object type");
#endif
@ -210,7 +210,7 @@ MacroAssembler::guardObjectType(Register obj, const TypeSet *types,
if (lastBranch.isInitialized())
lastBranch.emit(*this);
types::ObjectGroup *group = types->getGroupNoBarrier(i);
ObjectGroup *group = types->getGroupNoBarrier(i);
lastBranch = BranchGCPtr(Equal, scratch, ImmGCPtr(group), &matched);
}
}

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

@ -290,12 +290,12 @@ class MacroAssembler : public MacroAssemblerSpecific
}
void loadObjClass(Register objReg, Register dest) {
loadPtr(Address(objReg, JSObject::offsetOfGroup()), dest);
loadPtr(Address(dest, types::ObjectGroup::offsetOfClasp()), dest);
loadPtr(Address(dest, ObjectGroup::offsetOfClasp()), dest);
}
void branchTestObjClass(Condition cond, Register obj, Register scratch, const js::Class *clasp,
Label *label) {
loadPtr(Address(obj, JSObject::offsetOfGroup()), scratch);
branchPtr(cond, Address(scratch, types::ObjectGroup::offsetOfClasp()), ImmPtr(clasp), label);
branchPtr(cond, Address(scratch, ObjectGroup::offsetOfClasp()), ImmPtr(clasp), label);
}
void branchTestObjShape(Condition cond, Register obj, const Shape *shape, Label *label) {
branchPtr(cond, Address(obj, JSObject::offsetOfShape()), ImmGCPtr(shape), label);
@ -348,7 +348,7 @@ class MacroAssembler : public MacroAssemblerSpecific
void loadObjProto(Register obj, Register dest) {
loadPtr(Address(obj, JSObject::offsetOfGroup()), dest);
loadPtr(Address(dest, types::ObjectGroup::offsetOfProto()), dest);
loadPtr(Address(dest, ObjectGroup::offsetOfProto()), dest);
}
void loadStringLength(Register str, Register dest) {

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

@ -818,7 +818,7 @@ MaybeConstructorFromType(types::Type ty)
{
if (ty.isUnknown() || ty.isAnyObject() || !ty.isGroup())
return nullptr;
types::ObjectGroup *obj = ty.group();
ObjectGroup *obj = ty.group();
types::TypeNewScript *newScript = obj->newScript();
if (!newScript && obj->maybeUnboxedLayout())
newScript = obj->unboxedLayout().newScript();
@ -954,7 +954,7 @@ jit::WriteIonTrackedOptimizationsTable(JSContext *cx, CompactBufferWriter &write
} else {
JSScript *script;
uint32_t offset;
if (cx->findAllocationSiteForType(ty, &script, &offset)) {
if (ObjectGroup::findAllocationSiteForType(cx, ty, &script, &offset)) {
if (!allTypes->append(IonTrackedTypeWithAddendum(ty, script, offset)))
return false;
SpewAllocationSite(ty, script, offset);

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

@ -11,6 +11,7 @@
#include "jsarray.h"
#include "jit/MIR.h"
#include "jit/Snapshots.h"
struct JSContext;

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

@ -13,6 +13,7 @@
#include "jit/MIR.h"
#include "jit/MIRGenerator.h"
#include "jit/MIRGraph.h"
#include "vm/UnboxedObject.h"
namespace js {
namespace jit {

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

@ -1288,7 +1288,7 @@ MarkShapeFromIon(JSRuntime *rt, Shape **shapep)
}
void
MarkObjectGroupFromIon(JSRuntime *rt, types::ObjectGroup **groupp)
MarkObjectGroupFromIon(JSRuntime *rt, ObjectGroup **groupp)
{
gc::MarkObjectGroupUnbarriered(&rt->gc.marker, groupp, "write barrier");
}

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

@ -345,7 +345,7 @@ template <> struct TypeToArgProperties<HandleShape> {
static const uint32_t result = TypeToArgProperties<Shape *>::result | VMFunction::ByRef;
};
template <> struct TypeToArgProperties<HandleObjectGroup> {
static const uint32_t result = TypeToArgProperties<types::ObjectGroup *>::result | VMFunction::ByRef;
static const uint32_t result = TypeToArgProperties<ObjectGroup *>::result | VMFunction::ByRef;
};
// Convert argument type to whether or not it should be passed in a float
@ -759,7 +759,7 @@ void MarkValueFromIon(JSRuntime *rt, Value *vp);
void MarkStringFromIon(JSRuntime *rt, JSString **stringp);
void MarkObjectFromIon(JSRuntime *rt, JSObject **objp);
void MarkShapeFromIon(JSRuntime *rt, Shape **shapep);
void MarkObjectGroupFromIon(JSRuntime *rt, types::ObjectGroup **groupp);
void MarkObjectGroupFromIon(JSRuntime *rt, ObjectGroup **groupp);
// Helper for generatePreBarrier.
inline void *

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

@ -1991,7 +1991,7 @@ CodeGeneratorX86Shared::visitGuardClass(LGuardClass *guard)
Register tmp = ToRegister(guard->tempInt());
masm.loadPtr(Address(obj, JSObject::offsetOfGroup()), tmp);
masm.cmpPtr(Operand(tmp, types::ObjectGroup::offsetOfClasp()), ImmPtr(guard->mir()->getClass()));
masm.cmpPtr(Operand(tmp, ObjectGroup::offsetOfClasp()), ImmPtr(guard->mir()->getClass()));
bailoutIf(Assembler::NotEqual, guard->snapshot());
}

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

@ -43,6 +43,7 @@ UNIFIED_SOURCES += [
'testGCNursery.cpp',
'testGCOutOfMemory.cpp',
'testGCStoreBufferRemoval.cpp',
'testGetPropertyDescriptor.cpp',
'testHashTable.cpp',
'testHashTableInit.cpp',
'testIndexToString.cpp',

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше