Backed out changeset a296439a25ff (bug 1519636) for frequent Windows cppunit failures CLOSED TREE

This commit is contained in:
arthur.iakab 2019-05-24 14:26:01 +03:00
parent 5bed2b0138
commit af8e458c5f
159 changed files with 591 additions and 564 deletions

View file

@ -338,8 +338,7 @@ uint64_t HTMLTextFieldAccessible::NativeState() const {
return state | states::SUPPORTS_AUTOCOMPLETION | states::HASPOPUP; return state | states::SUPPORTS_AUTOCOMPLETION | states::HASPOPUP;
// Ordinal XUL textboxes don't support autocomplete. // Ordinal XUL textboxes don't support autocomplete.
if (!BindingOrWidgetParent() && if (!BindingOrWidgetParent() && Preferences::GetBool("browser.formfill.enable")) {
Preferences::GetBool("browser.formfill.enable")) {
// Check to see if autocompletion is allowed on this input. We don't expose // Check to see if autocompletion is allowed on this input. We don't expose
// it for password fields even though the entire password can be remembered // it for password fields even though the entire password can be remembered
// for a page if the user asks it to be. However, the kind of autocomplete // for a page if the user asks it to be. However, the kind of autocomplete

View file

@ -176,11 +176,11 @@ static mozilla::Maybe<bool> RunAsLauncherProcess(int& argc, wchar_t** argv) {
bool runAsLauncher = DoLauncherProcessChecks(argc, argv); bool runAsLauncher = DoLauncherProcessChecks(argc, argv);
#if defined(MOZ_LAUNCHER_PROCESS) #if defined(MOZ_LAUNCHER_PROCESS)
bool forceLauncher = bool forceLauncher = runAsLauncher &&
runAsLauncher &&
mozilla::CheckArg(argc, argv, L"force-launcher", mozilla::CheckArg(argc, argv, L"force-launcher",
static_cast<const wchar_t**>(nullptr), static_cast<const wchar_t**>(nullptr),
mozilla::CheckArgFlag::RemoveArg) == mozilla::ARG_FOUND; mozilla::CheckArgFlag::RemoveArg) ==
mozilla::ARG_FOUND;
mozilla::LauncherRegistryInfo::ProcessType desiredType = mozilla::LauncherRegistryInfo::ProcessType desiredType =
runAsLauncher ? mozilla::LauncherRegistryInfo::ProcessType::Launcher runAsLauncher ? mozilla::LauncherRegistryInfo::ProcessType::Launcher

View file

@ -49,7 +49,8 @@ NS_IMPL_CI_INTERFACE_GETTER(ContentPrincipal, nsIPrincipal, nsISerializable)
ContentPrincipal::ContentPrincipal() : BasePrincipal(eCodebasePrincipal) {} ContentPrincipal::ContentPrincipal() : BasePrincipal(eCodebasePrincipal) {}
ContentPrincipal::~ContentPrincipal() {} ContentPrincipal::~ContentPrincipal() {
}
nsresult ContentPrincipal::Init(nsIURI* aCodebase, nsresult ContentPrincipal::Init(nsIURI* aCodebase,
const OriginAttributes& aOriginAttributes, const OriginAttributes& aOriginAttributes,

View file

@ -814,8 +814,8 @@ void BrowsingContext::Transaction::Apply(BrowsingContext* aBrowsingContext,
} }
BrowsingContext::IPCInitializer BrowsingContext::GetIPCInitializer() { BrowsingContext::IPCInitializer BrowsingContext::GetIPCInitializer() {
MOZ_ASSERT(!mozilla::Preferences::GetBool( MOZ_ASSERT(
"fission.preserve_browsing_contexts", false) || !mozilla::Preferences::GetBool("fission.preserve_browsing_contexts", false) ||
IsContent()); IsContent());
IPCInitializer init; IPCInitializer init;

View file

@ -59,8 +59,7 @@ void ResizeObserverNotificationHelper::Unregister() {
} }
nsRefreshDriver* refreshDriver = GetRefreshDriver(); nsRefreshDriver* refreshDriver = GetRefreshDriver();
MOZ_RELEASE_ASSERT( MOZ_RELEASE_ASSERT(refreshDriver,
refreshDriver,
"We should not leave a dangling reference to the observer around"); "We should not leave a dangling reference to the observer around");
bool rv = refreshDriver->RemoveRefreshObserver(this, FlushType::Display); bool rv = refreshDriver->RemoveRefreshObserver(this, FlushType::Display);

View file

@ -15,8 +15,7 @@ namespace dom {
SerializedStackHolder::SerializedStackHolder() SerializedStackHolder::SerializedStackHolder()
: mHolder(StructuredCloneHolder::CloningSupported, : mHolder(StructuredCloneHolder::CloningSupported,
StructuredCloneHolder::TransferringNotSupported, StructuredCloneHolder::TransferringNotSupported,
StructuredCloneHolder::StructuredCloneScope:: StructuredCloneHolder::StructuredCloneScope::SameProcessDifferentThread) {}
SameProcessDifferentThread) {}
void SerializedStackHolder::WriteStack(JSContext* aCx, void SerializedStackHolder::WriteStack(JSContext* aCx,
JS::HandleObject aStack) { JS::HandleObject aStack) {
@ -38,8 +37,8 @@ void SerializedStackHolder::SerializeWorkerStack(JSContext* aCx,
JS::HandleObject aStack) { JS::HandleObject aStack) {
MOZ_ASSERT(aWorkerPrivate->IsOnCurrentThread()); MOZ_ASSERT(aWorkerPrivate->IsOnCurrentThread());
RefPtr<StrongWorkerRef> workerRef = RefPtr<StrongWorkerRef> workerRef = StrongWorkerRef::Create(
StrongWorkerRef::Create(aWorkerPrivate, "WorkerErrorReport"); aWorkerPrivate, "WorkerErrorReport");
if (workerRef) { if (workerRef) {
mWorkerRef = new ThreadSafeWorkerRef(workerRef); mWorkerRef = new ThreadSafeWorkerRef(workerRef);
} else { } else {
@ -79,7 +78,8 @@ JSObject* SerializedStackHolder::ReadStack(JSContext* aCx) {
} }
JS::RootedValue stackValue(aCx); JS::RootedValue stackValue(aCx);
mHolder.Read(xpc::CurrentNativeGlobal(aCx), aCx, &stackValue, IgnoreErrors()); mHolder.Read(xpc::CurrentNativeGlobal(aCx), aCx, &stackValue,
IgnoreErrors());
return stackValue.isObject() ? &stackValue.toObject() : nullptr; return stackValue.isObject() ? &stackValue.toObject() : nullptr;
} }
@ -92,8 +92,8 @@ UniquePtr<SerializedStackHolder> GetCurrentStackForNetMonitor(JSContext* aCx) {
return stack; return stack;
} }
void NotifyNetworkMonitorAlternateStack( void NotifyNetworkMonitorAlternateStack(nsISupports* aChannel,
nsISupports* aChannel, UniquePtr<SerializedStackHolder> aStackHolder) { UniquePtr<SerializedStackHolder> aStackHolder) {
if (!aStackHolder) { if (!aStackHolder) {
return; return;
} }
@ -121,8 +121,8 @@ void ConvertSerializedStackToJSON(UniquePtr<SerializedStackHolder> aStackHolder,
} }
JS::RootedObject converted(cx); JS::RootedObject converted(cx);
converted = JS::ConvertSavedFrameToPlainObject( converted = JS::ConvertSavedFrameToPlainObject(cx, savedFrame,
cx, savedFrame, JS::SavedFrameSelfHosted::Exclude); JS::SavedFrameSelfHosted::Exclude);
if (!converted) { if (!converted) {
JS_ClearPendingException(cx); JS_ClearPendingException(cx);
return; return;

View file

@ -59,8 +59,8 @@ UniquePtr<SerializedStackHolder> GetCurrentStackForNetMonitor(JSContext* aCx);
// thread. This call is synchronous, and aChannel and aStackHolder will not be // thread. This call is synchronous, and aChannel and aStackHolder will not be
// used afterward. aChannel is an nsISupports object because this can be used // used afterward. aChannel is an nsISupports object because this can be used
// with either nsIChannel or nsIWebSocketChannel. // with either nsIChannel or nsIWebSocketChannel.
void NotifyNetworkMonitorAlternateStack( void NotifyNetworkMonitorAlternateStack(nsISupports* aChannel,
nsISupports* aChannel, UniquePtr<SerializedStackHolder> aStackHolder); UniquePtr<SerializedStackHolder> aStackHolder);
// Read back the saved frame stack and store it in a string as JSON. // Read back the saved frame stack and store it in a string as JSON.
// This must be called on the main thread. // This must be called on the main thread.

View file

@ -81,11 +81,13 @@ void TabGroup::EnsureThrottledEventQueues() {
for (size_t i = 0; i < size_t(TaskCategory::Count); i++) { for (size_t i = 0; i < size_t(TaskCategory::Count); i++) {
TaskCategory category = static_cast<TaskCategory>(i); TaskCategory category = static_cast<TaskCategory>(i);
if (category == TaskCategory::Worker) { if (category == TaskCategory::Worker) {
mEventTargets[i] = ThrottledEventQueue::Create(mEventTargets[i], mEventTargets[i] =
ThrottledEventQueue::Create(mEventTargets[i],
"TabGroup worker queue"); "TabGroup worker queue");
} else if (category == TaskCategory::Timer) { } else if (category == TaskCategory::Timer) {
mEventTargets[i] = mEventTargets[i] =
ThrottledEventQueue::Create(mEventTargets[i], "TabGroup timer queue"); ThrottledEventQueue::Create(mEventTargets[i],
"TabGroup timer queue");
} }
} }
} }

View file

@ -4180,9 +4180,10 @@ void nsContentUtils::RequestFrameFocus(Element& aFrameElement, bool aCanRaise) {
RefPtr<Element> target = &aFrameElement; RefPtr<Element> target = &aFrameElement;
bool defaultAction = true; bool defaultAction = true;
if (aCanRaise) { if (aCanRaise) {
DispatchEventOnlyToChrome( DispatchEventOnlyToChrome(target->OwnerDoc(), target,
target->OwnerDoc(), target, NS_LITERAL_STRING("framefocusrequested"), NS_LITERAL_STRING("framefocusrequested"),
CanBubble::eYes, Cancelable::eYes, &defaultAction); CanBubble::eYes, Cancelable::eYes,
&defaultAction);
} }
if (!defaultAction) { if (!defaultAction) {
return; return;

View file

@ -142,9 +142,7 @@ mozilla::dom::Nullable<uint16_t> nsDOMDataChannel::GetMaxRetransmits() const {
return mDataChannel->GetMaxRetransmits(); return mDataChannel->GetMaxRetransmits();
} }
bool nsDOMDataChannel::Negotiated() const { bool nsDOMDataChannel::Negotiated() const { return mDataChannel->GetNegotiated(); }
return mDataChannel->GetNegotiated();
}
bool nsDOMDataChannel::Ordered() const { return mDataChannel->GetOrdered(); } bool nsDOMDataChannel::Ordered() const { return mDataChannel->GetOrdered(); }

View file

@ -617,8 +617,7 @@ nsresult nsDocumentEncoder::SerializeNodeStart(nsINode& aOriginalNode,
return rv; return rv;
} }
Element* originalElement = aOriginalNode.AsElement(); Element* originalElement = aOriginalNode.AsElement();
rv = mSerializer->AppendElementStart(node->AsElement(), originalElement, rv = mSerializer->AppendElementStart(node->AsElement(), originalElement, aStr);
aStr);
return rv; return rv;
} }

View file

@ -47,8 +47,7 @@ void nsFrameLoaderOwner::ChangeRemoteness(
// Policy, do not preserve the browsing context. Otherwise, save off the // Policy, do not preserve the browsing context. Otherwise, save off the
// browsing context and use it when creating our new FrameLoader. // browsing context and use it when creating our new FrameLoader.
if (!aOptions.mReplaceBrowsingContext && !isChromeRemoteToLocal && if (!aOptions.mReplaceBrowsingContext && !isChromeRemoteToLocal &&
mozilla::Preferences::GetBool("fission.preserve_browsing_contexts", mozilla::Preferences::GetBool("fission.preserve_browsing_contexts", false)) {
false)) {
bc = mFrameLoader->GetBrowsingContext(); bc = mFrameLoader->GetBrowsingContext();
mFrameLoader->SkipBrowsingContextDetach(); mFrameLoader->SkipBrowsingContextDetach();
} }

View file

@ -231,7 +231,9 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget,
} }
// nsIGlobalJSObjectHolder // nsIGlobalJSObjectHolder
JSObject* GetGlobalJSObject() final { return GetWrapper(); } JSObject* GetGlobalJSObject() final {
return GetWrapper();
}
JSObject* GetGlobalJSObjectPreserveColor() const final { JSObject* GetGlobalJSObjectPreserveColor() const final {
return GetWrapperPreserveColor(); return GetWrapperPreserveColor();
} }

View file

@ -134,8 +134,8 @@ void WebGLShader::CompileShader() {
PrintLongString(mCleanSource.BeginReading(), mCleanSource.Length()); PrintLongString(mCleanSource.BeginReading(), mCleanSource.Length());
} }
const bool success = Translate(mCleanSource, mValidator.get(), const bool success = Translate(mCleanSource, mValidator.get(), &mValidationLog,
&mValidationLog, &mTranslatedSource); &mTranslatedSource);
if (MOZ_UNLIKELY(kDumpShaders)) { if (MOZ_UNLIKELY(kDumpShaders)) {
printf_stderr("\n==== \\/ \\/ \\/ ====\n"); printf_stderr("\n==== \\/ \\/ \\/ ====\n");

View file

@ -18,7 +18,6 @@ namespace webgl {
class ShaderValidator final { class ShaderValidator final {
public: public:
const ShHandle mHandle; const ShHandle mHandle;
private: private:
const ShCompileOptions mCompileOptions; const ShCompileOptions mCompileOptions;
const int mMaxVaryingVectors; const int mMaxVaryingVectors;

View file

@ -518,8 +518,8 @@ void PointerEventHandler::DispatchPointerFromMouseOrTouch(
break; break;
case eMouseDown: case eMouseDown:
pointerMessage = pointerMessage =
mouseEvent->mButtons & ~nsContentUtils::GetButtonsFlagForButton( mouseEvent->mButtons &
mouseEvent->mButton) ~nsContentUtils::GetButtonsFlagForButton(mouseEvent->mButton)
? ePointerMove ? ePointerMove
: ePointerDown; : ePointerDown;
break; break;

View file

@ -55,7 +55,9 @@ class BrowserHost : public RemoteBrowser,
ContentParent* GetContentParent() const { ContentParent* GetContentParent() const {
return mRoot ? mRoot->Manager() : nullptr; return mRoot ? mRoot->Manager() : nullptr;
} }
TabId GetTabId() const { return mId; } TabId GetTabId() const {
return mId;
}
BrowserHost* AsBrowserHost() override { return this; } BrowserHost* AsBrowserHost() override { return this; }
BrowserBridgeHost* AsBrowserBridgeHost() override { return nullptr; } BrowserBridgeHost* AsBrowserBridgeHost() override { return nullptr; }

View file

@ -137,9 +137,9 @@ using namespace mozilla::widget;
using namespace mozilla::jsipc; using namespace mozilla::jsipc;
using namespace mozilla::gfx; using namespace mozilla::gfx;
using mozilla::Unused;
using mozilla::LazyLogModule; using mozilla::LazyLogModule;
using mozilla::StaticAutoPtr; using mozilla::StaticAutoPtr;
using mozilla::Unused;
LazyLogModule gBrowserFocusLog("BrowserFocus"); LazyLogModule gBrowserFocusLog("BrowserFocus");

View file

@ -974,14 +974,10 @@ long AudioCallbackDriver::DataCallback(const AudioDataValue* aInputBuffer,
static const char* StateToString(cubeb_state aState) { static const char* StateToString(cubeb_state aState) {
switch (aState) { switch (aState) {
case CUBEB_STATE_STARTED: case CUBEB_STATE_STARTED: return "STARTED";
return "STARTED"; case CUBEB_STATE_STOPPED: return "STOPPED";
case CUBEB_STATE_STOPPED: case CUBEB_STATE_DRAINED: return "DRAINED";
return "STOPPED"; case CUBEB_STATE_ERROR: return "ERROR";
case CUBEB_STATE_DRAINED:
return "DRAINED";
case CUBEB_STATE_ERROR:
return "ERROR";
default: default:
MOZ_CRASH("Unexpected state!"); MOZ_CRASH("Unexpected state!");
} }
@ -989,8 +985,7 @@ static const char* StateToString(cubeb_state aState) {
void AudioCallbackDriver::StateCallback(cubeb_state aState) { void AudioCallbackDriver::StateCallback(cubeb_state aState) {
MOZ_ASSERT(!OnGraphThread()); MOZ_ASSERT(!OnGraphThread());
LOG(LogLevel::Debug, LOG(LogLevel::Debug, ("AudioCallbackDriver State: %s", StateToString(aState)));
("AudioCallbackDriver State: %s", StateToString(aState)));
// Clear the flag for the not running // Clear the flag for the not running
// states: stopped, drained, error. // states: stopped, drained, error.

View file

@ -345,7 +345,8 @@ void PDMFactory::CreatePDMs() {
return; return;
} }
if (StaticPrefs::MediaRddProcessEnabled() && BrowserTabsRemoteAutostart()) { if (StaticPrefs::MediaRddProcessEnabled()
&& BrowserTabsRemoteAutostart()) {
m = new RemoteDecoderModule; m = new RemoteDecoderModule;
StartupPDM(m); StartupPDM(m);
} }

View file

@ -26,7 +26,8 @@ bool AgnosticDecoderModule::SupportsMimeType(
VPXDecoder::IsVPX(aMimeType) || OpusDataDecoder::IsOpus(aMimeType) || VPXDecoder::IsVPX(aMimeType) || OpusDataDecoder::IsOpus(aMimeType) ||
WaveDataDecoder::IsWave(aMimeType) || TheoraDecoder::IsTheora(aMimeType); WaveDataDecoder::IsWave(aMimeType) || TheoraDecoder::IsTheora(aMimeType);
if (!StaticPrefs::MediaRddVorbisEnabled() || if (!StaticPrefs::MediaRddVorbisEnabled() ||
!StaticPrefs::MediaRddProcessEnabled() || !BrowserTabsRemoteAutostart()) { !StaticPrefs::MediaRddProcessEnabled() ||
!BrowserTabsRemoteAutostart()) {
supports |= VorbisDataDecoder::IsVorbis(aMimeType); supports |= VorbisDataDecoder::IsVorbis(aMimeType);
} }
#ifdef MOZ_AV1 #ifdef MOZ_AV1

View file

@ -43,7 +43,8 @@ using namespace net;
namespace dom { namespace dom {
static void FireInteralError(TCPSocketParent* aActor, uint32_t aLineNo) { static void FireInteralError(TCPSocketParent* aActor,
uint32_t aLineNo) {
MOZ_ASSERT(aActor->IPCOpen()); MOZ_ASSERT(aActor->IPCOpen());
mozilla::Unused << aActor->SendCallback( mozilla::Unused << aActor->SendCallback(

View file

@ -66,7 +66,9 @@ struct GCPolicy<nsJSObjWrapper*> {
(*wrapper)->trace(trc); (*wrapper)->trace(trc);
} }
static bool isValid(const nsJSObjWrapper*& wrapper) { return true; } static bool isValid(const nsJSObjWrapper *&wrapper) {
return true;
}
}; };
} // namespace JS } // namespace JS

View file

@ -173,8 +173,7 @@ class QuotaManager final : public BackgroundThreadObject {
/** /**
* For use when creating an origin directory. It's possible that origin usage * For use when creating an origin directory. It's possible that origin usage
* is already being tracked due to a call to EnsureQuotaForOrigin, and in that * is already being tracked due to a call to EnsureQuotaForOrigin, and in that
* case we need to update the existing OriginInfo rather than create a new * case we need to update the existing OriginInfo rather than create a new one.
* one.
*/ */
void NoteOriginDirectoryCreated(PersistenceType aPersistenceType, void NoteOriginDirectoryCreated(PersistenceType aPersistenceType,
const nsACString& aGroup, const nsACString& aGroup,

View file

@ -75,8 +75,8 @@ void StorageNotifierService::Broadcast(StorageEvent* aEvent,
// No reasons to continue if the principal of the event doesn't match with // No reasons to continue if the principal of the event doesn't match with
// the window's one. // the window's one.
if (!StorageUtils::PrincipalsEqual( if (!StorageUtils::PrincipalsEqual(aEvent->GetPrincipal(),
aEvent->GetPrincipal(), observer->GetEffectiveStoragePrincipal())) { observer->GetEffectiveStoragePrincipal())) {
continue; continue;
} }

View file

@ -165,11 +165,9 @@ class SVGPathData {
* which is generated by cbindgen from Rust (see ServoStyleConsts.h). * which is generated by cbindgen from Rust (see ServoStyleConsts.h).
* Basically, this is a variant of the above BuildPath() functions. * Basically, this is a variant of the above BuildPath() functions.
*/ */
static already_AddRefed<Path> BuildPath(Span<const StylePathCommand> aPath, static already_AddRefed<Path> BuildPath(
PathBuilder* aBuilder, Span<const StylePathCommand> aPath, PathBuilder* aBuilder,
uint8_t aStrokeLineCap, uint8_t aStrokeLineCap, Float aStrokeWidth, float aZoomFactor = 1.0);
Float aStrokeWidth,
float aZoomFactor = 1.0);
const_iterator begin() const { return mData.Elements(); } const_iterator begin() const { return mData.Elements(); }
const_iterator end() const { return mData.Elements() + mData.Length(); } const_iterator end() const { return mData.Elements() + mData.Length(); }

View file

@ -1649,8 +1649,8 @@ nsresult WebSocketImpl::Init(JSContext* aCx, nsIPrincipal* aLoadingPrincipal,
return NS_OK; return NS_OK;
} }
nsresult WebSocketImpl::AsyncOpen( nsresult WebSocketImpl::AsyncOpen(nsIPrincipal* aPrincipal,
nsIPrincipal* aPrincipal, uint64_t aInnerWindowID, uint64_t aInnerWindowID,
nsITransportProvider* aTransportProvider, nsITransportProvider* aTransportProvider,
const nsACString& aNegotiatedExtensions, const nsACString& aNegotiatedExtensions,
UniquePtr<SerializedStackHolder> aOriginStack) { UniquePtr<SerializedStackHolder> aOriginStack) {

View file

@ -844,7 +844,8 @@ class ScriptLoaderRunnable final : public nsIRunnable, public nsINamed {
// thread) explicitly, so that we can use the stack to notify the net // thread) explicitly, so that we can use the stack to notify the net
// monitor about every script we load. // monitor about every script we load.
if (mOriginStack) { if (mOriginStack) {
ConvertSerializedStackToJSON(std::move(mOriginStack), mOriginStackJSON); ConvertSerializedStackToJSON(std::move(mOriginStack),
mOriginStackJSON);
} }
if (!mWorkerPrivate->IsServiceWorker() || IsDebuggerScript()) { if (!mWorkerPrivate->IsServiceWorker() || IsDebuggerScript()) {
@ -2124,8 +2125,8 @@ void LoadAllScripts(WorkerPrivate* aWorkerPrivate,
} }
RefPtr<ScriptLoaderRunnable> loader = new ScriptLoaderRunnable( RefPtr<ScriptLoaderRunnable> loader = new ScriptLoaderRunnable(
aWorkerPrivate, std::move(aOriginStack), syncLoopTarget, aLoadInfos, aWorkerPrivate, std::move(aOriginStack), syncLoopTarget, aLoadInfos, clientInfo,
clientInfo, controller, aIsMainScript, aWorkerScriptType, aRv); controller, aIsMainScript, aWorkerScriptType, aRv);
NS_ASSERTION(aLoadInfos.IsEmpty(), "Should have swapped!"); NS_ASSERTION(aLoadInfos.IsEmpty(), "Should have swapped!");

View file

@ -310,8 +310,7 @@ class CompileScriptRunnable final : public WorkerDebuggeeRunnable {
UniquePtr<SerializedStackHolder> aOriginStack, UniquePtr<SerializedStackHolder> aOriginStack,
const nsAString& aScriptURL) const nsAString& aScriptURL)
: WorkerDebuggeeRunnable(aWorkerPrivate, WorkerThreadModifyBusyCount), : WorkerDebuggeeRunnable(aWorkerPrivate, WorkerThreadModifyBusyCount),
mScriptURL(aScriptURL), mScriptURL(aScriptURL), mOriginStack(aOriginStack.release()) {}
mOriginStack(aOriginStack.release()) {}
private: private:
// We can't implement PreRun effectively, because at the point when that would // We can't implement PreRun effectively, because at the point when that would
@ -2179,8 +2178,9 @@ WorkerPrivate::WorkerPrivate(WorkerPrivate* aParent,
mMainThreadEventTargetForMessaging = mMainThreadEventTargetForMessaging =
ThrottledEventQueue::Create(target, "Worker queue for messaging"); ThrottledEventQueue::Create(target, "Worker queue for messaging");
if (StaticPrefs::dom_worker_use_medium_high_event_queue()) { if (StaticPrefs::dom_worker_use_medium_high_event_queue()) {
mMainThreadEventTarget = ThrottledEventQueue::Create( mMainThreadEventTarget =
GetMainThreadSerialEventTarget(), "Worker queue", ThrottledEventQueue::Create(GetMainThreadSerialEventTarget(),
"Worker queue",
nsIRunnablePriority::PRIORITY_MEDIUMHIGH); nsIRunnablePriority::PRIORITY_MEDIUMHIGH);
} else { } else {
mMainThreadEventTarget = mMainThreadEventTargetForMessaging; mMainThreadEventTarget = mMainThreadEventTargetForMessaging;

View file

@ -766,7 +766,9 @@ class WorkerPrivate : public RelativeTimeline {
return mLoadInfo.mServiceWorkersTestingInWindow; return mLoadInfo.mServiceWorkersTestingInWindow;
} }
bool IsWatchedByDevtools() const { return mLoadInfo.mWatchedByDevtools; } bool IsWatchedByDevtools() const {
return mLoadInfo.mWatchedByDevtools;
}
// Determine if the worker is currently loading its top level script. // Determine if the worker is currently loading its top level script.
bool IsLoadingWorkerScript() const { return mLoadingWorkerScript; } bool IsLoadingWorkerScript() const { return mLoadingWorkerScript; }

View file

@ -141,7 +141,9 @@ static void NotifySubdocumentInvalidation(
} }
static void SetChildrenChangedRecursive(Layer* aLayer) { static void SetChildrenChangedRecursive(Layer* aLayer) {
ForEachNode<ForwardIterator>(aLayer, [](Layer* layer) { ForEachNode<ForwardIterator>(
aLayer,
[](Layer* layer) {
ContainerLayer* container = layer->AsContainerLayer(); ContainerLayer* container = layer->AsContainerLayer();
if (container) { if (container) {
container->SetChildrenChanged(true); container->SetChildrenChanged(true);

View file

@ -590,7 +590,6 @@ class APZCTreeManager : public IAPZCTreeManager, public APZInputBridge {
// Also used for controlling time during tests // Also used for controlling time during tests
void SetTestSampleTime(const Maybe<TimeStamp>& aTime); void SetTestSampleTime(const Maybe<TimeStamp>& aTime);
private: private:
Maybe<TimeStamp> mTestSampleTime; Maybe<TimeStamp> mTestSampleTime;

View file

@ -666,7 +666,8 @@ static bool PrepareForSetTargetAPZCNotification(
nsIWidget* aWidget, const LayersId& aLayersId, nsIFrame* aRootFrame, nsIWidget* aWidget, const LayersId& aLayersId, nsIFrame* aRootFrame,
const LayoutDeviceIntPoint& aRefPoint, const LayoutDeviceIntPoint& aRefPoint,
nsTArray<SLGuidAndRenderRoot>* aTargets) { nsTArray<SLGuidAndRenderRoot>* aTargets) {
SLGuidAndRenderRoot guid(aLayersId, 0, ScrollableLayerGuid::NULL_SCROLL_ID, SLGuidAndRenderRoot guid(aLayersId, 0,
ScrollableLayerGuid::NULL_SCROLL_ID,
wr::RenderRoot::Default); wr::RenderRoot::Default);
nsPoint point = nsLayoutUtils::GetEventCoordinatesRelativeTo( nsPoint point = nsLayoutUtils::GetEventCoordinatesRelativeTo(
aWidget, aRefPoint, aRootFrame); aWidget, aRefPoint, aRootFrame);
@ -817,11 +818,9 @@ void DisplayportSetListener::DidRefresh() {
} }
UniquePtr<DisplayportSetListener> UniquePtr<DisplayportSetListener>
APZCCallbackHelper::SendSetTargetAPZCNotification(nsIWidget* aWidget, APZCCallbackHelper::SendSetTargetAPZCNotification(
dom::Document* aDocument, nsIWidget* aWidget, dom::Document* aDocument, const WidgetGUIEvent& aEvent,
const WidgetGUIEvent& aEvent, const LayersId& aLayersId, uint64_t aInputBlockId) {
const LayersId& aLayersId,
uint64_t aInputBlockId) {
if (!aWidget || !aDocument) { if (!aWidget || !aDocument) {
return nullptr; return nullptr;
} }

View file

@ -176,8 +176,8 @@ void APZEventState::ProcessSingleTap(const CSSPoint& aPoint,
const CSSToLayoutDeviceScale& aScale, const CSSToLayoutDeviceScale& aScale,
Modifiers aModifiers, Modifiers aModifiers,
int32_t aClickCount) { int32_t aClickCount) {
APZES_LOG("Handling single tap at %s with %d\n", Stringify(aPoint).c_str(), APZES_LOG("Handling single tap at %s with %d\n",
mTouchEndCancelled); Stringify(aPoint).c_str(), mTouchEndCancelled);
RefPtr<nsIContent> touchRollup = GetTouchRollup(); RefPtr<nsIContent> touchRollup = GetTouchRollup();
mTouchRollup = nullptr; mTouchRollup = nullptr;

View file

@ -225,6 +225,7 @@ BasicCompositor::BasicCompositor(CompositorBridgeParent* aParent,
mMaxTextureSize = mMaxTextureSize =
std::min(Factory::GetMaxSurfaceSize(gfxVars::ContentBackend()), std::min(Factory::GetMaxSurfaceSize(gfxVars::ContentBackend()),
Factory::GetMaxSurfaceSize(BackendType::CAIRO)); Factory::GetMaxSurfaceSize(BackendType::CAIRO));
} }
BasicCompositor::~BasicCompositor() { MOZ_COUNT_DTOR(BasicCompositor); } BasicCompositor::~BasicCompositor() { MOZ_COUNT_DTOR(BasicCompositor); }

View file

@ -451,8 +451,7 @@ CompositorD3D11::CreateRenderTargetFromSource(
bool CompositorD3D11::ShouldAllowFrameRecording() const { bool CompositorD3D11::ShouldAllowFrameRecording() const {
#ifdef MOZ_GECKO_PROFILER #ifdef MOZ_GECKO_PROFILER
return mAllowFrameRecording || return mAllowFrameRecording || profiler_feature_active(ProfilerFeature::Screenshots);
profiler_feature_active(ProfilerFeature::Screenshots);
#else #else
return mAllowFrameRecording; return mAllowFrameRecording;
#endif #endif

View file

@ -485,8 +485,8 @@ void WebRenderLayerManager::MakeSnapshotIfRequired(LayoutDeviceIntSize aSize) {
SurfaceFormat::B8G8R8A8; SurfaceFormat::B8G8R8A8;
#endif #endif
RefPtr<TextureClient> texture = TextureClient::CreateForRawBufferAccess( RefPtr<TextureClient> texture = TextureClient::CreateForRawBufferAccess(
WrBridge(), format, aSize.ToUnknownSize(), BackendType::SKIA, WrBridge(), format, aSize.ToUnknownSize(),
TextureFlags::SNAPSHOT); BackendType::SKIA, TextureFlags::SNAPSHOT);
if (!texture) { if (!texture) {
return; return;
} }

View file

@ -332,9 +332,8 @@ void Family::SearchAllFontsForChar(FontList* aList,
// already checked character coverage, do it now (note that // already checked character coverage, do it now (note that
// HasCharacter() will trigger loading the fontEntry's cmap, if // HasCharacter() will trigger loading the fontEntry's cmap, if
// needed). // needed).
RefPtr<gfxFontEntry> fe = RefPtr<gfxFontEntry> fe = gfxPlatformFontList::PlatformFontList()
gfxPlatformFontList::PlatformFontList()->GetOrCreateFontEntry(face, ->GetOrCreateFontEntry(face, this);
this);
if (!fe) { if (!fe) {
continue; continue;
} }
@ -359,8 +358,9 @@ void Family::SetFacePtrs(FontList* aList, nsTArray<Pointer>& aFaces) {
// them at the appropriate slots in mFaces and set the mIsSimple flag to // them at the appropriate slots in mFaces and set the mIsSimple flag to
// accelerate font-matching. // accelerate font-matching.
bool isSimple = true; bool isSimple = true;
Pointer slots[4] = {Pointer::Null(), Pointer::Null(), Pointer::Null(), Pointer slots[4] = {
Pointer::Null()}; Pointer::Null(), Pointer::Null(), Pointer::Null(), Pointer::Null()
};
for (const Pointer& fp : aFaces) { for (const Pointer& fp : aFaces) {
const Face* f = static_cast<const Face*>(fp.ToPtr(aList)); const Face* f = static_cast<const Face*>(fp.ToPtr(aList));
if (!f->mWeight.IsSingle() || !f->mStyle.IsSingle() || if (!f->mWeight.IsSingle() || !f->mStyle.IsSingle() ||

View file

@ -140,7 +140,8 @@ gfxFontEntry::~gfxFontEntry() {
MOZ_ASSERT(!mGrFaceInitialized); MOZ_ASSERT(!mGrFaceInitialized);
} }
bool gfxFontEntry::TrySetShmemCharacterMap() { bool gfxFontEntry::TrySetShmemCharacterMap()
{
MOZ_ASSERT(mShmemFace); MOZ_ASSERT(mShmemFace);
auto list = gfxPlatformFontList::PlatformFontList()->SharedFontList(); auto list = gfxPlatformFontList::PlatformFontList()->SharedFontList();
mShmemCharacterMap = mShmemCharacterMap =

View file

@ -487,8 +487,7 @@ inline void gfxSparseBitSet::Union(const SharedBitSet& aBitset) {
mBlockIndex.AppendElement(NO_BLOCK); mBlockIndex.AppendElement(NO_BLOCK);
} }
auto blockIndex = reinterpret_cast<const uint16_t*>(&aBitset + 1); auto blockIndex = reinterpret_cast<const uint16_t*>(&aBitset + 1);
auto blocks = auto blocks = reinterpret_cast<const Block*>(blockIndex + aBitset.mBlockIndexCount);
reinterpret_cast<const Block*>(blockIndex + aBitset.mBlockIndexCount);
for (uint32_t i = 0; i < aBitset.mBlockIndexCount; ++i) { for (uint32_t i = 0; i < aBitset.mBlockIndexCount; ++i) {
// if it is missing (implicitly empty) in source, just skip // if it is missing (implicitly empty) in source, just skip
if (blockIndex[i] == NO_BLOCK) { if (blockIndex[i] == NO_BLOCK) {
@ -502,9 +501,10 @@ inline void gfxSparseBitSet::Union(const SharedBitSet& aBitset) {
continue; continue;
} }
// else set existing target block to the union of both // else set existing target block to the union of both
uint32_t* dst = reinterpret_cast<uint32_t*>(&mBlocks[mBlockIndex[i]].mBits); uint32_t* dst = reinterpret_cast<uint32_t*>(
const uint32_t* src = &mBlocks[mBlockIndex[i]].mBits);
reinterpret_cast<const uint32_t*>(&blocks[blockIndex[i]].mBits); const uint32_t* src = reinterpret_cast<const uint32_t*>(
&blocks[blockIndex[i]].mBits);
for (uint32_t j = 0; j < BLOCK_SIZE / 4; ++j) { for (uint32_t j = 0; j < BLOCK_SIZE / 4; ++j) {
dst[j] |= src[j]; dst[j] |= src[j];
} }

View file

@ -1763,7 +1763,8 @@ void gfxMacPlatformFontList::ActivateFontsFromDir(nsIFile* aDir) {
} }
void gfxMacPlatformFontList::GetFacesInitDataForFamily( void gfxMacPlatformFontList::GetFacesInitDataForFamily(
const fontlist::Family* aFamily, nsTArray<fontlist::Face::InitData>& aFaces) const { const fontlist::Family* aFamily,
nsTArray<fontlist::Face::InitData>& aFaces) const {
nsAutoreleasePool localPool; nsAutoreleasePool localPool;
NS_ConvertUTF8toUTF16 name(aFamily->Key().AsString(SharedFontList())); NS_ConvertUTF8toUTF16 name(aFamily->Key().AsString(SharedFontList()));
@ -1859,7 +1860,8 @@ void gfxMacPlatformFontList::ReadFaceNamesForFamily(fontlist::Family* aFamily,
// of the macOS UI font; see MacOSFontEntry::GetFontRef(). We pass 16.0 in // of the macOS UI font; see MacOSFontEntry::GetFontRef(). We pass 16.0 in
// order to get a standard text-size face in this case, although it's // order to get a standard text-size face in this case, although it's
// unlikely to matter for the purpose of just reading family names. // unlikely to matter for the purpose of just reading family names.
auto fe = MakeUnique<MacOSFontEntry>(name, WeightRange(FontWeight::Normal()), false, 16.0); auto fe = MakeUnique<MacOSFontEntry>(name, WeightRange(FontWeight::Normal()),
false, 16.0);
if (!fe) { if (!fe) {
continue; continue;
} }
@ -1870,8 +1872,8 @@ void gfxMacPlatformFontList::ReadFaceNamesForFamily(fontlist::Family* aFamily,
uint32_t dataLength; uint32_t dataLength;
const char* nameData = hb_blob_get_data(nameTable, &dataLength); const char* nameData = hb_blob_get_data(nameTable, &dataLength);
AutoTArray<nsCString, 4> otherFamilyNames; AutoTArray<nsCString, 4> otherFamilyNames;
gfxFontUtils::ReadOtherFamilyNamesForFace(canonicalName, nameData, dataLength, otherFamilyNames, gfxFontUtils::ReadOtherFamilyNamesForFace(canonicalName, nameData, dataLength,
false); otherFamilyNames, false);
for (const auto& alias : otherFamilyNames) { for (const auto& alias : otherFamilyNames) {
auto af = mAliasTable.LookupOrAdd(alias); auto af = mAliasTable.LookupOrAdd(alias);
af->AppendElement(facePtrs[i]); af->AppendElement(facePtrs[i]);

View file

@ -129,7 +129,8 @@ bool RendererOGL::UpdateAndRender(const Maybe<gfx::IntSize>& aReadbackSize,
MOZ_ASSERT(aReadbackSize.isSome()); MOZ_ASSERT(aReadbackSize.isSome());
MOZ_ASSERT(aReadbackFormat.isSome()); MOZ_ASSERT(aReadbackFormat.isSome());
wr_renderer_readback(mRenderer, aReadbackSize.ref().width, wr_renderer_readback(mRenderer, aReadbackSize.ref().width,
aReadbackSize.ref().height, aReadbackFormat.ref(), aReadbackSize.ref().height,
aReadbackFormat.ref(),
&aReadbackBuffer.ref()[0], &aReadbackBuffer.ref()[0],
aReadbackBuffer.ref().length()); aReadbackBuffer.ref().length());
} }

View file

@ -430,10 +430,7 @@ void WebRenderAPI::Readback(const TimeStamp& aStartTime, gfx::IntSize size,
explicit Readback(layers::SynchronousTask* aTask, TimeStamp aStartTime, explicit Readback(layers::SynchronousTask* aTask, TimeStamp aStartTime,
gfx::IntSize aSize, const gfx::SurfaceFormat& aFormat, gfx::IntSize aSize, const gfx::SurfaceFormat& aFormat,
const Range<uint8_t>& aBuffer) const Range<uint8_t>& aBuffer)
: mTask(aTask), : mTask(aTask), mStartTime(aStartTime), mSize(aSize), mFormat(aFormat),
mStartTime(aStartTime),
mSize(aSize),
mFormat(aFormat),
mBuffer(aBuffer) { mBuffer(aBuffer) {
MOZ_COUNT_CTOR(Readback); MOZ_COUNT_CTOR(Readback);
} }
@ -1164,7 +1161,8 @@ void DisplayListBuilder::PushShadow(const wr::LayoutRect& aRect,
// being re-enabled mid-shadow. The optimization is restored in PopAllShadows. // being re-enabled mid-shadow. The optimization is restored in PopAllShadows.
SuspendClipLeafMerging(); SuspendClipLeafMerging();
wr_dp_push_shadow(mWrState, aRect, aClip, aIsBackfaceVisible, wr_dp_push_shadow(mWrState, aRect, aClip, aIsBackfaceVisible,
&mCurrentSpaceAndClipChain, aShadow, aShouldInflate); &mCurrentSpaceAndClipChain, aShadow,
aShouldInflate);
} }
void DisplayListBuilder::PopAllShadows() { void DisplayListBuilder::PopAllShadows() {

View file

@ -25,8 +25,8 @@ class nsHyphenator {
private: private:
~nsHyphenator(); ~nsHyphenator();
void HyphenateWord(const nsAString& aString, uint32_t aStart, uint32_t aLimit, void HyphenateWord(const nsAString& aString, uint32_t aStart,
nsTArray<bool>& aHyphens); uint32_t aLimit, nsTArray<bool>& aHyphens);
void* mDict; void* mDict;
bool mHyphenateCapitalized; bool mHyphenateCapitalized;

View file

@ -89,26 +89,22 @@ ProcessRuntime::ProcessRuntime(GeckoProcessType aProcessType)
nsAutoHandle mtaThreadImpToken(rawMtaThreadImpToken); nsAutoHandle mtaThreadImpToken(rawMtaThreadImpToken);
SandboxTarget::Instance()->RegisterSandboxStartCallback([]() -> void { SandboxTarget::Instance()->RegisterSandboxStartCallback([]() -> void {
EnsureMTA( EnsureMTA([]() -> void {
[]() -> void {
// This is a security risk if it fails, so we release assert // This is a security risk if it fails, so we release assert
MOZ_RELEASE_ASSERT(::RevertToSelf(), MOZ_RELEASE_ASSERT(::RevertToSelf(),
"mscom::ProcessRuntime RevertToSelf failed"); "mscom::ProcessRuntime RevertToSelf failed");
}, }, EnsureMTA::Option::ForceDispatch);
EnsureMTA::Option::ForceDispatch);
}); });
// Impersonate and initialize. // Impersonate and initialize.
EnsureMTA( EnsureMTA([this, rawMtaThreadImpToken]() -> void {
[this, rawMtaThreadImpToken]() -> void {
if (!::SetThreadToken(nullptr, rawMtaThreadImpToken)) { if (!::SetThreadToken(nullptr, rawMtaThreadImpToken)) {
mInitResult = HRESULT_FROM_WIN32(::GetLastError()); mInitResult = HRESULT_FROM_WIN32(::GetLastError());
return; return;
} }
InitInsideApartment(); InitInsideApartment();
}, }, EnsureMTA::Option::ForceDispatch);
EnsureMTA::Option::ForceDispatch);
return; return;
} }

View file

@ -35,8 +35,7 @@ class AllocPolicyBase {
return js_pod_arena_calloc<T>(arenaId, numElems); return js_pod_arena_calloc<T>(arenaId, numElems);
} }
template <typename T> template <typename T>
T* maybe_pod_arena_realloc(arena_id_t arenaId, T* p, size_t oldSize, T* maybe_pod_arena_realloc(arena_id_t arenaId, T* p, size_t oldSize, size_t newSize) {
size_t newSize) {
return js_pod_arena_realloc<T>(arenaId, p, oldSize, newSize); return js_pod_arena_realloc<T>(arenaId, p, oldSize, newSize);
} }
template <typename T> template <typename T>
@ -48,8 +47,7 @@ class AllocPolicyBase {
return maybe_pod_arena_calloc<T>(arenaId, numElems); return maybe_pod_arena_calloc<T>(arenaId, numElems);
} }
template <typename T> template <typename T>
T* pod_arena_realloc(arena_id_t arenaId, T* p, size_t oldSize, T* pod_arena_realloc(arena_id_t arenaId, T* p, size_t oldSize, size_t newSize) {
size_t newSize) {
return maybe_pod_arena_realloc<T>(arenaId, p, oldSize, newSize); return maybe_pod_arena_realloc<T>(arenaId, p, oldSize, newSize);
} }
@ -145,8 +143,7 @@ class TempAllocPolicy : public AllocPolicyBase {
} }
template <typename T> template <typename T>
T* pod_arena_realloc(arena_id_t arenaId, T* prior, size_t oldSize, T* pod_arena_realloc(arena_id_t arenaId, T* prior, size_t oldSize, size_t newSize) {
size_t newSize) {
T* p2 = this->maybe_pod_arena_realloc<T>(arenaId, prior, oldSize, newSize); T* p2 = this->maybe_pod_arena_realloc<T>(arenaId, prior, oldSize, newSize);
if (MOZ_UNLIKELY(!p2)) { if (MOZ_UNLIKELY(!p2)) {
p2 = onOutOfMemoryTyped<T>(arenaId, AllocFunction::Realloc, newSize, p2 = onOutOfMemoryTyped<T>(arenaId, AllocFunction::Realloc, newSize,

View file

@ -1035,8 +1035,7 @@ class MOZ_RAII Rooted : public js::RootedBase<T, Rooted<T>> {
// If T can be constructed with a cx, then define another constructor for it // If T can be constructed with a cx, then define another constructor for it
// that will be preferred. // that will be preferred.
template <typename RootingContext, template <typename RootingContext,
typename = typename std::enable_if< typename = typename std::enable_if<std::is_constructible<T, RootingContext>::value>::type>
std::is_constructible<T, RootingContext>::value>::type>
Rooted(const RootingContext& cx, CtorDispatcher, detail::PreferredOverload) Rooted(const RootingContext& cx, CtorDispatcher, detail::PreferredOverload)
: Rooted(cx, T(cx)) {} : Rooted(cx, T(cx)) {}

View file

@ -554,12 +554,12 @@ const jsid* SliceRootedIdVector(const JS::PersistentRootedIdVector* v,
void DestroyRootedIdVector(JS::PersistentRootedIdVector* v) { delete v; } void DestroyRootedIdVector(JS::PersistentRootedIdVector* v) { delete v; }
JS::MutableHandleIdVector GetMutableHandleIdVector( JS::MutableHandleIdVector GetMutableHandleIdVector(JS::PersistentRootedIdVector* v) {
JS::PersistentRootedIdVector* v) {
return JS::MutableHandleIdVector(v); return JS::MutableHandleIdVector(v);
} }
JS::PersistentRootedObjectVector* CreateRootedObjectVector(JSContext* aCx) { JS::PersistentRootedObjectVector* CreateRootedObjectVector(
JSContext* aCx) {
JS::PersistentRootedObjectVector* vec = JS::PersistentRootedObjectVector* vec =
new JS::PersistentRootedObjectVector(aCx); new JS::PersistentRootedObjectVector(aCx);
return vec; return vec;
@ -570,7 +570,9 @@ bool AppendToRootedObjectVector(JS::PersistentRootedObjectVector* v,
return v->append(obj); return v->append(obj);
} }
void DeleteRootedObjectVector(JS::PersistentRootedObjectVector* v) { delete v; } void DeleteRootedObjectVector(JS::PersistentRootedObjectVector* v) {
delete v;
}
#if defined(__linux__) #if defined(__linux__)
# include <malloc.h> # include <malloc.h>

View file

@ -1057,8 +1057,9 @@ bool ModuleObject::execute(JSContext* cx, HandleModuleObject self,
// The top-level script if a module is only ever executed once. Clear the // The top-level script if a module is only ever executed once. Clear the
// reference at exit to prevent us keeping this alive unnecessarily. This is // reference at exit to prevent us keeping this alive unnecessarily. This is
// kept while executing so it is available to the debugger. // kept while executing so it is available to the debugger.
auto guardA = mozilla::MakeScopeExit( auto guardA = mozilla::MakeScopeExit([&] {
[&] { self->setReservedSlot(ScriptSlot, UndefinedValue()); }); self->setReservedSlot(ScriptSlot, UndefinedValue());
});
RootedModuleEnvironmentObject scope(cx, self->environment()); RootedModuleEnvironmentObject scope(cx, self->environment());
if (!scope) { if (!scope) {

View file

@ -2650,8 +2650,8 @@ bool ASTSerializer::expression(ParseNode* pn, MutableHandleValue dst) {
switch (pn->getKind()) { switch (pn->getKind()) {
case ParseNodeKind::Function: { case ParseNodeKind::Function: {
FunctionNode* funNode = &pn->as<FunctionNode>(); FunctionNode* funNode = &pn->as<FunctionNode>();
ASTType type = ASTType type = funNode->funbox()->isArrow() ? AST_ARROW_EXPR
funNode->funbox()->isArrow() ? AST_ARROW_EXPR : AST_FUNC_EXPR; : AST_FUNC_EXPR;
return function(funNode, type, dst); return function(funNode, type, dst);
} }
@ -3144,9 +3144,9 @@ bool ASTSerializer::property(ParseNode* pn, MutableHandleValue dst) {
ParseNode* valNode = node->right(); ParseNode* valNode = node->right();
bool isShorthand = node->isKind(ParseNodeKind::Shorthand); bool isShorthand = node->isKind(ParseNodeKind::Shorthand);
bool isMethod = bool isMethod = valNode->is<FunctionNode>() &&
valNode->is<FunctionNode>() && valNode->as<FunctionNode>().funbox()->kind() ==
valNode->as<FunctionNode>().funbox()->kind() == JSFunction::Method; JSFunction::Method;
RootedValue key(cx), val(cx); RootedValue key(cx), val(cx);
return propertyName(keyNode, &key) && expression(valNode, &val) && return propertyName(keyNode, &key) && expression(valNode, &val) &&
builder.propertyInitializer(key, val, kind, isShorthand, isMethod, builder.propertyInitializer(key, val, kind, isShorthand, isMethod,

View file

@ -3484,7 +3484,9 @@ class MOZ_RAII AutoClearUnderlyingSource {
} }
} }
void reset() { controller_ = nullptr; } void reset() {
controller_ = nullptr;
}
}; };
/** /**

View file

@ -3227,7 +3227,8 @@ JS::Result<Ok> BinASTParser<Tok>::parseInterfaceFunctionExpressionContents(
// Per spec, isFunctionNameCaptured can be true for anonymous // Per spec, isFunctionNameCaptured can be true for anonymous
// function. Check isFunctionNameCaptured only for named // function. Check isFunctionNameCaptured only for named
// function. // function.
if (pc_->functionBox()->isNamedLambda() && isFunctionNameCaptured) { if (pc_->functionBox()->isNamedLambda() &&
isFunctionNameCaptured) {
captureFunctionName(); captureFunctionName();
} }
BINJS_MOZ_TRY_DECL(isThisCaptured, tokenizer_->readBool(fieldContext++)); BINJS_MOZ_TRY_DECL(isThisCaptured, tokenizer_->readBool(fieldContext++));

View file

@ -104,6 +104,7 @@ struct CGResumeOffsetList {
void finish(mozilla::Span<uint32_t> array); void finish(mozilla::Span<uint32_t> array);
}; };
static constexpr size_t MaxBytecodeLength = INT32_MAX; static constexpr size_t MaxBytecodeLength = INT32_MAX;
static constexpr size_t MaxSrcNotesLength = INT32_MAX; static constexpr size_t MaxSrcNotesLength = INT32_MAX;

View file

@ -475,7 +475,8 @@ bool FunctionScriptEmitter::prepareForBody() {
} }
} }
if (funbox_->kind() == JSFunction::FunctionKind::ClassConstructor) { if (funbox_->kind() ==
JSFunction::FunctionKind::ClassConstructor) {
if (!funbox_->isDerivedClassConstructor()) { if (!funbox_->isDerivedClassConstructor()) {
if (!bce_->emitInitializeInstanceFields()) { if (!bce_->emitInitializeInstanceFields()) {
// [stack] // [stack]

View file

@ -296,7 +296,8 @@ bool ParseContext::annexBAppliesToLexicalFunctionInInnermostScope(
FunctionBox* funbox) { FunctionBox* funbox) {
MOZ_ASSERT(!sc()->strict()); MOZ_ASSERT(!sc()->strict());
RootedPropertyName name(sc()->cx_, funbox->explicitName()->asPropertyName()); RootedPropertyName name(sc()->cx_,
funbox->explicitName()->asPropertyName());
Maybe<DeclarationKind> redeclaredKind = isVarRedeclaredInInnermostScope( Maybe<DeclarationKind> redeclaredKind = isVarRedeclaredInInnermostScope(
name, DeclarationKind::VarForAnnexBLexicalFunction); name, DeclarationKind::VarForAnnexBLexicalFunction);

View file

@ -623,7 +623,8 @@ class ParseContext : public Nestable<ParseContext> {
} }
bool isGetterOrSetter() const { bool isGetterOrSetter() const {
return sc_->isFunctionBox() && (sc_->asFunctionBox()->isGetter() || return sc_->isFunctionBox() &&
(sc_->asFunctionBox()->isGetter() ||
sc_->asFunctionBox()->isSetter()); sc_->asFunctionBox()->isSetter());
} }

View file

@ -163,7 +163,8 @@ FunctionBox::FunctionBox(JSContext* cx, TraceListNode* traceListHead,
isSetter_(fun->isSetter()), isSetter_(fun->isSetter()),
isMethod_(fun->isMethod()), isMethod_(fun->isMethod()),
kind_(fun->kind()), kind_(fun->kind()),
explicitName_(fun->explicitName()) { explicitName_(fun->explicitName())
{
// Functions created at parse time may be set singleton after parsing and // Functions created at parse time may be set singleton after parsing and
// baked into JIT code, so they must be allocated tenured. They are held by // baked into JIT code, so they must be allocated tenured. They are held by
// the JSScript so cannot be collected during a minor GC anyway. // the JSScript so cannot be collected during a minor GC anyway.
@ -194,8 +195,7 @@ void FunctionBox::initStandaloneFunction(Scope* enclosingScope) {
thisBinding_ = ThisBinding::Function; thisBinding_ = ThisBinding::Function;
} }
void FunctionBox::initWithEnclosingParseContext(ParseContext* enclosing, void FunctionBox::initWithEnclosingParseContext(ParseContext* enclosing, JSFunction* fun,
JSFunction* fun,
FunctionSyntaxKind kind) { FunctionSyntaxKind kind) {
SharedContext* sc = enclosing->sc(); SharedContext* sc = enclosing->sc();
useAsm = sc->isFunctionBox() && sc->asFunctionBox()->useAsmOrInsideUseAsm(); useAsm = sc->isFunctionBox() && sc->asFunctionBox()->useAsmOrInsideUseAsm();

View file

@ -435,8 +435,7 @@ class FunctionBox : public ObjectBox, public SharedContext {
void initStandaloneFunction(Scope* enclosingScope); void initStandaloneFunction(Scope* enclosingScope);
void initWithEnclosingParseContext(ParseContext* enclosing, JSFunction* fun, void initWithEnclosingParseContext(ParseContext* enclosing, JSFunction* fun,
FunctionSyntaxKind kind); FunctionSyntaxKind kind);
void initFieldInitializer(ParseContext* enclosing, JSFunction* fun, void initFieldInitializer(ParseContext* enclosing, JSFunction* fun, HasHeritage hasHeritage);
HasHeritage hasHeritage);
inline bool isLazyFunctionWithoutEnclosingScope() const { inline bool isLazyFunctionWithoutEnclosingScope() const {
return function()->isInterpretedLazy() && return function()->isInterpretedLazy() &&

View file

@ -425,7 +425,8 @@ class MOZ_NON_MEMMOVABLE BarrieredBase {
// Base class for barriered pointer types that intercept only writes. // Base class for barriered pointer types that intercept only writes.
template <class T> template <class T>
class WriteBarriered : public BarrieredBase<T>, class WriteBarriered
: public BarrieredBase<T>,
public WrappedPtrOperations<T, WriteBarriered<T>> { public WrappedPtrOperations<T, WriteBarriered<T>> {
protected: protected:
using BarrieredBase<T>::value; using BarrieredBase<T>::value;

View file

@ -110,7 +110,10 @@ class ArenaCellIter {
traceKind(JS::TraceKind::Null), traceKind(JS::TraceKind::Null),
initialized(false) {} initialized(false) {}
explicit ArenaCellIter(Arena* arena) : initialized(false) { init(arena); } explicit ArenaCellIter(Arena* arena)
: initialized(false) {
init(arena);
}
void init(Arena* arena) { void init(Arena* arena) {
MOZ_ASSERT(!initialized); MOZ_ASSERT(!initialized);
@ -392,7 +395,9 @@ class ZoneCellIter : protected ZoneAllCellIter<T> {
return cell; return cell;
} }
T* get() const { return reinterpret_cast<T*>(getCell()); } T* get() const {
return reinterpret_cast<T*>(getCell());
}
TenuredCell* unbarrieredGetCell() const { return Base::getCell(); } TenuredCell* unbarrieredGetCell() const { return Base::getCell(); }
T* unbarrieredGet() const { return Base::get(); } T* unbarrieredGet() const { return Base::get(); }

View file

@ -3104,7 +3104,8 @@ size_t js::TenuringTracer::moveStringToTenured(JSString* dst, JSString* src,
} }
if (dst->isFlat() && !dst->isInline()) { if (dst->isFlat() && !dst->isInline()) {
AddCellMemory(dst, dst->asFlat().allocSize(), MemoryUse::StringContents); AddCellMemory(dst, dst->asFlat().allocSize(),
MemoryUse::StringContents);
} }
return size; return size;

View file

@ -22,7 +22,8 @@ namespace detail {
template <typename T> template <typename T>
class UnsafeBareWeakHeapPtr : public ReadBarriered<T> { class UnsafeBareWeakHeapPtr : public ReadBarriered<T> {
public: public:
UnsafeBareWeakHeapPtr() : ReadBarriered<T>(JS::SafelyInitialized<T>()) {} UnsafeBareWeakHeapPtr()
: ReadBarriered<T>(JS::SafelyInitialized<T>()) {}
MOZ_IMPLICIT UnsafeBareWeakHeapPtr(const T& v) : ReadBarriered<T>(v) {} MOZ_IMPLICIT UnsafeBareWeakHeapPtr(const T& v) : ReadBarriered<T>(v) {}
explicit UnsafeBareWeakHeapPtr(const UnsafeBareWeakHeapPtr& v) explicit UnsafeBareWeakHeapPtr(const UnsafeBareWeakHeapPtr& v)
: ReadBarriered<T>(v) {} : ReadBarriered<T>(v) {}
@ -180,7 +181,8 @@ class NurseryAwareHashMap {
namespace JS { namespace JS {
template <typename T> template <typename T>
struct GCPolicy<js::detail::UnsafeBareWeakHeapPtr<T>> { struct GCPolicy<js::detail::UnsafeBareWeakHeapPtr<T>> {
static void trace(JSTracer* trc, js::detail::UnsafeBareWeakHeapPtr<T>* thingp, static void trace(JSTracer* trc,
js::detail::UnsafeBareWeakHeapPtr<T>* thingp,
const char* name) { const char* name) {
js::TraceEdge(trc, thingp, name); js::TraceEdge(trc, thingp, name);
} }

View file

@ -20,14 +20,16 @@ namespace gc {
class ArenaCellIterUnderGC : public ArenaCellIter { class ArenaCellIterUnderGC : public ArenaCellIter {
public: public:
explicit ArenaCellIterUnderGC(Arena* arena) : ArenaCellIter(arena) { explicit ArenaCellIterUnderGC(Arena* arena)
: ArenaCellIter(arena) {
MOZ_ASSERT(CurrentThreadIsPerformingGC()); MOZ_ASSERT(CurrentThreadIsPerformingGC());
} }
}; };
class ArenaCellIterUnderFinalize : public ArenaCellIter { class ArenaCellIterUnderFinalize : public ArenaCellIter {
public: public:
explicit ArenaCellIterUnderFinalize(Arena* arena) : ArenaCellIter(arena) { explicit ArenaCellIterUnderFinalize(Arena* arena)
: ArenaCellIter(arena) {
MOZ_ASSERT(CurrentThreadIsGCSweeping()); MOZ_ASSERT(CurrentThreadIsGCSweeping());
} }
}; };

View file

@ -126,7 +126,8 @@ inline void TraceEdge(JSTracer* trc, WriteBarriered<T>* thingp,
} }
template <typename T> template <typename T>
inline void TraceEdge(JSTracer* trc, WeakHeapPtr<T>* thingp, const char* name) { inline void TraceEdge(JSTracer* trc, WeakHeapPtr<T>* thingp,
const char* name) {
gc::TraceEdgeInternal(trc, gc::ConvertToBase(thingp->unsafeGet()), name); gc::TraceEdgeInternal(trc, gc::ConvertToBase(thingp->unsafeGet()), name);
} }
@ -160,7 +161,8 @@ inline void TraceRoot(JSTracer* trc, T* thingp, const char* name) {
} }
template <typename T> template <typename T>
inline void TraceRoot(JSTracer* trc, WeakHeapPtr<T>* thingp, const char* name) { inline void TraceRoot(JSTracer* trc, WeakHeapPtr<T>* thingp,
const char* name) {
TraceRoot(trc, thingp->unsafeGet(), name); TraceRoot(trc, thingp->unsafeGet(), name);
} }
@ -211,7 +213,8 @@ void TraceRootRange(JSTracer* trc, size_t len, T* vec, const char* name) {
// Trace an edge that crosses compartment boundaries. If the compartment of the // Trace an edge that crosses compartment boundaries. If the compartment of the
// destination thing is not being GC'd, then the edge will not be traced. // destination thing is not being GC'd, then the edge will not be traced.
void TraceCrossCompartmentEdge(JSTracer* trc, JSObject* src, void TraceCrossCompartmentEdge(JSTracer* trc, JSObject* src,
WriteBarriered<Value>* dst, const char* name); WriteBarriered<Value>* dst,
const char* name);
// As above but with manual barriers. // As above but with manual barriers.
template <typename T> template <typename T>

View file

@ -24,11 +24,13 @@ enum class CellColor : uint8_t {
Black = uint8_t(MarkColor::Black) Black = uint8_t(MarkColor::Black)
}; };
static constexpr CellColor AllCellColors[] = {CellColor::White, CellColor::Gray, static constexpr CellColor AllCellColors[] = {
CellColor::Black}; CellColor::White, CellColor::Gray, CellColor::Black
};
static constexpr CellColor MarkedCellColors[] = {CellColor::Gray, static constexpr CellColor MarkedCellColors[] = {
CellColor::Black}; CellColor::Gray, CellColor::Black
};
inline CellColor GetCellColor(Cell* cell) { inline CellColor GetCellColor(Cell* cell) {
if (cell->isMarkedBlack()) { if (cell->isMarkedBlack()) {

View file

@ -30,7 +30,9 @@ void MacroAssembler::move16SignExtend(Register src, Register dest) {
ma_seh(dest, src); ma_seh(dest, src);
} }
void MacroAssembler::loadAbiReturnAddress(Register dest) { movePtr(ra, dest); } void MacroAssembler::loadAbiReturnAddress(Register dest) {
movePtr(ra, dest);
}
// =============================================================== // ===============================================================
// Logical instructions // Logical instructions

View file

@ -163,13 +163,14 @@ bool TestJSWeakMaps() {
for (auto keyOrDelegateColor : MarkedCellColors) { for (auto keyOrDelegateColor : MarkedCellColors) {
for (auto mapColor : MarkedCellColors) { for (auto mapColor : MarkedCellColors) {
for (auto markKeyOrDelegate : { MarkKey, MarkDelegate }) { for (auto markKeyOrDelegate : { MarkKey, MarkDelegate }) {
CellColor expected = CellColor expected = ExpectedWeakMapValueColor(keyOrDelegateColor,
ExpectedWeakMapValueColor(keyOrDelegateColor, mapColor); mapColor);
CHECK(TestJSWeakMap(markKeyOrDelegate, keyOrDelegateColor, mapColor, CHECK(TestJSWeakMap(markKeyOrDelegate, keyOrDelegateColor, mapColor,
expected)); expected));
#ifdef JS_GC_ZEAL #ifdef JS_GC_ZEAL
CHECK(TestJSWeakMapWithGrayUnmarking( CHECK(TestJSWeakMapWithGrayUnmarking(markKeyOrDelegate,
markKeyOrDelegate, keyOrDelegateColor, mapColor, expected)); keyOrDelegateColor, mapColor,
expected));
#endif #endif
} }
} }
@ -188,13 +189,14 @@ bool TestInternalWeakMaps() {
CellColor keyOrDelegateColor = CellColor keyOrDelegateColor =
ExpectedKeyAndDelegateColor(keyMarkColor, delegateMarkColor); ExpectedKeyAndDelegateColor(keyMarkColor, delegateMarkColor);
CellColor expected = CellColor expected = ExpectedWeakMapValueColor(keyOrDelegateColor,
ExpectedWeakMapValueColor(keyOrDelegateColor, CellColor::Black); CellColor::Black);
CHECK(TestInternalWeakMap(keyMarkColor, delegateMarkColor, expected)); CHECK(TestInternalWeakMap(keyMarkColor, delegateMarkColor, expected));
#ifdef JS_GC_ZEAL #ifdef JS_GC_ZEAL
CHECK(TestInternalWeakMapWithGrayUnmarking(keyMarkColor, CHECK(TestInternalWeakMapWithGrayUnmarking(keyMarkColor,
delegateMarkColor, expected)); delegateMarkColor,
expected));
#endif #endif
} }
} }

View file

@ -956,7 +956,8 @@ void ArrayBufferObject::releaseData(FreeOp* fop) {
break; break;
case MAPPED: case MAPPED:
gc::DeallocateMappedContent(dataPointer(), byteLength()); gc::DeallocateMappedContent(dataPointer(), byteLength());
RemoveCellMemory(this, associatedBytes(), MemoryUse::ArrayBufferContents); RemoveCellMemory(this, associatedBytes(),
MemoryUse::ArrayBufferContents);
break; break;
case WASM: case WASM:
WasmArrayRawBuffer::Release(dataPointer()); WasmArrayRawBuffer::Release(dataPointer());

View file

@ -46,8 +46,8 @@ struct AtomHasher {
const Lookup& lookup); const Lookup& lookup);
}; };
using AtomSet = using AtomSet = JS::GCHashSet<WeakHeapPtr<JSAtom*>, AtomHasher,
JS::GCHashSet<WeakHeapPtr<JSAtom*>, AtomHasher, SystemAllocPolicy>; SystemAllocPolicy>;
// This class is a wrapper for AtomSet that is used to ensure the AtomSet is // This class is a wrapper for AtomSet that is used to ensure the AtomSet is
// not modified. It should only expose read-only methods from AtomSet. // not modified. It should only expose read-only methods from AtomSet.

View file

@ -563,9 +563,8 @@ JS_PUBLIC_API bool JS::Evaluate(JSContext* cx,
size_t length = srcBuf.length(); size_t length = srcBuf.length();
auto chars = UniqueTwoByteChars( auto chars = UniqueTwoByteChars(
UTF8CharsToNewTwoByteCharsZ(cx, UTF8Chars(srcBuf.get(), length), &length, UTF8CharsToNewTwoByteCharsZ(cx, UTF8Chars(srcBuf.get(), length),
js::MallocArena) &length, js::MallocArena).get());
.get());
if (!chars) { if (!chars) {
return false; return false;
} }

View file

@ -56,8 +56,8 @@
return slowPathCheckNoExecute(cx, script); return slowPathCheckNoExecute(cx, script);
} }
/* static */ inline js::ResumeMode js::Debugger::onEnterFrame( /* static */ inline js::ResumeMode js::Debugger::onEnterFrame(JSContext* cx,
JSContext* cx, AbstractFramePtr frame) { AbstractFramePtr frame) {
MOZ_ASSERT_IF(frame.hasScript() && frame.script()->isDebuggee(), MOZ_ASSERT_IF(frame.hasScript() && frame.script()->isDebuggee(),
frame.isDebuggee()); frame.isDebuggee());
if (!frame.isDebuggee()) { if (!frame.isDebuggee()) {
@ -99,8 +99,8 @@
} }
} }
/* static */ inline void js::Debugger::onNewPromise( /* static */ inline void js::Debugger::onNewPromise(JSContext* cx,
JSContext* cx, Handle<PromiseObject*> promise) { Handle<PromiseObject*> promise) {
if (MOZ_UNLIKELY(cx->realm()->isDebuggee())) { if (MOZ_UNLIKELY(cx->realm()->isDebuggee())) {
slowPathPromiseHook(cx, Debugger::OnNewPromise, promise); slowPathPromiseHook(cx, Debugger::OnNewPromise, promise);
} }

View file

@ -1787,8 +1787,7 @@ class DebugEnvironmentProxyHandler : public BaseProxyHandler {
return env.as<CallObject>().callee().nonLazyScript()->bodyScope(); return env.as<CallObject>().callee().nonLazyScript()->bodyScope();
} }
if (env.is<ModuleEnvironmentObject>()) { if (env.is<ModuleEnvironmentObject>()) {
JSScript* script = JSScript* script = env.as<ModuleEnvironmentObject>().module().maybeScript();
env.as<ModuleEnvironmentObject>().module().maybeScript();
return script ? script->bodyScope() : nullptr; return script ? script->bodyScope() : nullptr;
} }
if (isNonExtensibleLexicalEnvironment(env)) { if (isNonExtensibleLexicalEnvironment(env)) {

View file

@ -964,7 +964,8 @@ class DebugEnvironments {
* environments. * environments.
*/ */
typedef GCHashMap<WeakHeapPtr<JSObject*>, LiveEnvironmentVal, typedef GCHashMap<WeakHeapPtr<JSObject*>, LiveEnvironmentVal,
MovableCellHasher<WeakHeapPtr<JSObject*>>, ZoneAllocPolicy> MovableCellHasher<WeakHeapPtr<JSObject*>>,
ZoneAllocPolicy>
LiveEnvironmentMap; LiveEnvironmentMap;
LiveEnvironmentMap liveEnvs; LiveEnvironmentMap liveEnvs;

View file

@ -132,8 +132,7 @@ class AbstractGeneratorObject : public NativeObject {
// Note: also update Baseline's IsSuspendedGenerator code if this // Note: also update Baseline's IsSuspendedGenerator code if this
// changes. // changes.
Value resumeIndex = getFixedSlot(RESUME_INDEX_SLOT); Value resumeIndex = getFixedSlot(RESUME_INDEX_SLOT);
return resumeIndex.isInt32() && return resumeIndex.isInt32() && resumeIndex.toInt32() < RESUME_INDEX_RUNNING;
resumeIndex.toInt32() < RESUME_INDEX_RUNNING;
} }
void setRunning() { void setRunning() {
MOZ_ASSERT(isSuspended()); MOZ_ASSERT(isSuspended());

View file

@ -535,7 +535,9 @@ struct JSRuntime : public js::MallocProvider<JSRuntime> {
void incrementNumDebuggeeRealms(); void incrementNumDebuggeeRealms();
void decrementNumDebuggeeRealms(); void decrementNumDebuggeeRealms();
size_t numDebuggeeRealms() const { return numDebuggeeRealms_; } size_t numDebuggeeRealms() const {
return numDebuggeeRealms_;
}
void incrementNumDebuggeeRealmsObservingCoverage(); void incrementNumDebuggeeRealmsObservingCoverage();
void decrementNumDebuggeeRealmsObservingCoverage(); void decrementNumDebuggeeRealmsObservingCoverage();

View file

@ -106,7 +106,8 @@ class SavedFrame : public NativeObject {
struct Lookup; struct Lookup;
struct HashPolicy; struct HashPolicy;
typedef JS::GCHashSet<WeakHeapPtr<SavedFrame*>, HashPolicy, SystemAllocPolicy> typedef JS::GCHashSet<WeakHeapPtr<SavedFrame*>, HashPolicy,
SystemAllocPolicy>
Set; Set;
private: private:

View file

@ -1095,9 +1095,8 @@ static bool AssignProperty(JSContext* cx, HandleObject dst, HandleObject src,
JS_DefineProperty(cx, dst, property, v, JSPROP_ENUMERATE); JS_DefineProperty(cx, dst, property, v, JSPROP_ENUMERATE);
} }
JS_PUBLIC_API JSObject* ConvertSavedFrameToPlainObject( JS_PUBLIC_API JSObject* ConvertSavedFrameToPlainObject
JSContext* cx, HandleObject savedFrameArg, (JSContext* cx, HandleObject savedFrameArg, SavedFrameSelfHosted selfHosted) {
SavedFrameSelfHosted selfHosted) {
MOZ_ASSERT(savedFrameArg); MOZ_ASSERT(savedFrameArg);
RootedObject savedFrame(cx, savedFrameArg); RootedObject savedFrame(cx, savedFrameArg);

View file

@ -896,8 +896,8 @@ struct DefaultHasher<jsid> {
namespace js { namespace js {
using BaseShapeSet = using BaseShapeSet =
JS::WeakCache<JS::GCHashSet<WeakHeapPtr<UnownedBaseShape*>, StackBaseShape, JS::WeakCache<JS::GCHashSet<WeakHeapPtr<UnownedBaseShape*>,
SystemAllocPolicy>>; StackBaseShape, SystemAllocPolicy>>;
class Shape : public gc::TenuredCell { class Shape : public gc::TenuredCell {
friend class ::JSObject; friend class ::JSObject;

View file

@ -437,8 +437,8 @@ inline void JSFlatString::finalize(js::FreeOp* fop) {
inline size_t JSFlatString::allocSize() const { inline size_t JSFlatString::allocSize() const {
MOZ_ASSERT(!isInline()); MOZ_ASSERT(!isInline());
size_t charSize = size_t charSize = hasLatin1Chars() ? sizeof(JS::Latin1Char)
hasLatin1Chars() ? sizeof(JS::Latin1Char) : sizeof(char16_t); : sizeof(char16_t);
size_t count = isExtensible() ? asExtensible().capacity() : length(); size_t count = isExtensible() ? asExtensible().capacity() : length();
return (count + 1) * charSize; return (count + 1) * charSize;
} }

View file

@ -577,7 +577,8 @@ JSFlatString* JSRope::flattenInternal(JSContext* maybecx) {
// Remove memory association for left node we're about to make into a // Remove memory association for left node we're about to make into a
// dependent string. // dependent string.
if (left.isTenured()) { if (left.isTenured()) {
RemoveCellMemory(&left, left.allocSize(), MemoryUse::StringContents); RemoveCellMemory(&left, left.allocSize(),
MemoryUse::StringContents);
} }
if (IsSame<CharT, char16_t>::value) { if (IsSame<CharT, char16_t>::value) {
@ -664,7 +665,8 @@ finish_node : {
str->d.s.u3.capacity = wholeCapacity; str->d.s.u3.capacity = wholeCapacity;
if (str->isTenured()) { if (str->isTenured()) {
AddCellMemory(str, str->asFlat().allocSize(), MemoryUse::StringContents); AddCellMemory(str, str->asFlat().allocSize(),
MemoryUse::StringContents);
} }
return &this->asFlat(); return &this->asFlat();
@ -1474,7 +1476,8 @@ JSFlatString* JSExternalString::ensureFlat(JSContext* cx) {
finalize(cx->runtime()->defaultFreeOp()); finalize(cx->runtime()->defaultFreeOp());
MOZ_ASSERT(isTenured()); MOZ_ASSERT(isTenured());
AddCellMemory(this, (n + 1) * sizeof(char16_t), MemoryUse::StringContents); AddCellMemory(this, (n + 1) * sizeof(char16_t),
MemoryUse::StringContents);
// Transform the string into a non-external, flat string. Note that the // Transform the string into a non-external, flat string. Note that the
// resulting string will still be in an AllocKind::EXTERNAL_STRING arena, // resulting string will still be in an AllocKind::EXTERNAL_STRING arena,

View file

@ -572,6 +572,7 @@ static ParseNode* ElemIndex(ParseNode* pn) {
return &pn->as<PropertyByValue>().key(); return &pn->as<PropertyByValue>().key();
} }
static inline PropertyName* FunctionName(FunctionNode* funNode) { static inline PropertyName* FunctionName(FunctionNode* funNode) {
if (JSAtom* name = funNode->funbox()->explicitName()) { if (JSAtom* name = funNode->funbox()->explicitName()) {
return name->asPropertyName(); return name->asPropertyName();
@ -6033,8 +6034,7 @@ static bool ParseFunction(ModuleValidator<Unit>& m, FunctionNode** funNodeOut,
if (!funbox) { if (!funbox) {
return false; return false;
} }
funbox->initWithEnclosingParseContext(outerpc, fun, funbox->initWithEnclosingParseContext(outerpc, fun, FunctionSyntaxKind::Statement);
FunctionSyntaxKind::Statement);
Directives newDirectives = directives; Directives newDirectives = directives;
SourceParseContext funpc(&m.parser(), funbox, &newDirectives); SourceParseContext funpc(&m.parser(), funbox, &newDirectives);

View file

@ -292,10 +292,9 @@ class WasmMemoryObject : public NativeObject {
static bool grow(JSContext* cx, unsigned argc, Value* vp); static bool grow(JSContext* cx, unsigned argc, Value* vp);
static uint32_t growShared(HandleWasmMemoryObject memory, uint32_t delta); static uint32_t growShared(HandleWasmMemoryObject memory, uint32_t delta);
using InstanceSet = using InstanceSet = JS::WeakCache<GCHashSet<
JS::WeakCache<GCHashSet<WeakHeapPtrWasmInstanceObject, WeakHeapPtrWasmInstanceObject,
MovableCellHasher<WeakHeapPtrWasmInstanceObject>, MovableCellHasher<WeakHeapPtrWasmInstanceObject>, SystemAllocPolicy>>;
SystemAllocPolicy>>;
bool hasObservers() const; bool hasObservers() const;
InstanceSet& observers() const; InstanceSet& observers() const;
InstanceSet* getOrCreateObservers(JSContext* cx); InstanceSet* getOrCreateObservers(JSContext* cx);

View file

@ -41,10 +41,9 @@ STATIC_ASSERT_ANYREF_IS_JSOBJECT;
typedef GCVector<HeapPtr<JSObject*>, 0, SystemAllocPolicy> TableAnyRefVector; typedef GCVector<HeapPtr<JSObject*>, 0, SystemAllocPolicy> TableAnyRefVector;
class Table : public ShareableBase<Table> { class Table : public ShareableBase<Table> {
using InstanceSet = using InstanceSet = JS::WeakCache<GCHashSet<
JS::WeakCache<GCHashSet<WeakHeapPtrWasmInstanceObject, WeakHeapPtrWasmInstanceObject,
MovableCellHasher<WeakHeapPtrWasmInstanceObject>, MovableCellHasher<WeakHeapPtrWasmInstanceObject>, SystemAllocPolicy>>;
SystemAllocPolicy>>;
using UniqueFuncRefArray = UniquePtr<FunctionTableElem[], JS::FreePolicy>; using UniqueFuncRefArray = UniquePtr<FunctionTableElem[], JS::FreePolicy>;
WeakHeapPtrWasmTableObject maybeObject_; WeakHeapPtrWasmTableObject maybeObject_;

View file

@ -1827,7 +1827,8 @@ static void ReportRealmStats(const JS::RealmStats& realmStats,
realmStats.ionData, realmStats.ionData,
"The IonMonkey JIT's compilation data (IonScripts)."); "The IonMonkey JIT's compilation data (IonScripts).");
ZRREPORT_BYTES(realmJSPathPrefix + NS_LITERAL_CSTRING("jit-scripts"), ZRREPORT_BYTES(
realmJSPathPrefix + NS_LITERAL_CSTRING("jit-scripts"),
realmStats.jitScripts, realmStats.jitScripts,
"JIT and Type Inference data associated with scripts."); "JIT and Type Inference data associated with scripts.");

View file

@ -3642,8 +3642,8 @@ static bool DescendIntoChild(nsDisplayListBuilder* aBuilder,
} }
nsDisplayTableBackgroundSet* tableBGs = aBuilder->GetTableBackgroundSet(); nsDisplayTableBackgroundSet* tableBGs = aBuilder->GetTableBackgroundSet();
if (tableBGs && tableBGs->GetDirtyRect().Intersects( if (tableBGs &&
normalPositionOverflowRelativeToTable)) { tableBGs->GetDirtyRect().Intersects(normalPositionOverflowRelativeToTable)) {
return true; return true;
} }
} }

View file

@ -130,8 +130,7 @@ bool RetainedDisplayListBuilder::PreProcessDisplayList(
// list build if we hit them. // list build if we hit them.
static const uint32_t kMaxEdgeRatio = 5; static const uint32_t kMaxEdgeRatio = 5;
const bool initializeDAG = !aList->mDAG.Length(); const bool initializeDAG = !aList->mDAG.Length();
if (!aKeepLinked && !initializeDAG && if (!aKeepLinked && !initializeDAG && aList->mDAG.mDirectPredecessorList.Length() >
aList->mDAG.mDirectPredecessorList.Length() >
(aList->mDAG.mNodesInfo.Length() * kMaxEdgeRatio)) { (aList->mDAG.mNodesInfo.Length() * kMaxEdgeRatio)) {
return false; return false;
} }
@ -228,9 +227,7 @@ bool RetainedDisplayListBuilder::PreProcessDisplayList(
if (!PreProcessDisplayList( if (!PreProcessDisplayList(
item->GetChildren(), SelectAGRForFrame(f, aAGR), aUpdated, item->GetChildren(), SelectAGRForFrame(f, aAGR), aUpdated,
item->GetPerFrameKey(), aNestingDepth + 1, keepLinked)) { item->GetPerFrameKey(), aNestingDepth + 1, keepLinked)) {
MOZ_RELEASE_ASSERT( MOZ_RELEASE_ASSERT(!aKeepLinked, "Can't early return since we need to move the out list back");
!aKeepLinked,
"Can't early return since we need to move the out list back");
return false; return false;
} }
} }
@ -1204,7 +1201,8 @@ static void AddFramesForContainingBlock(nsIFrame* aBlock,
// ancestors must also be visited). // ancestors must also be visited).
static void FindContainingBlocks(nsIFrame* aFrame, static void FindContainingBlocks(nsIFrame* aFrame,
nsTArray<nsIFrame*>& aExtraFrames) { nsTArray<nsIFrame*>& aExtraFrames) {
for (nsIFrame* f = aFrame; f; f = nsLayoutUtils::GetDisplayListParent(f)) { for (nsIFrame* f = aFrame; f;
f = nsLayoutUtils::GetDisplayListParent(f)) {
if (f->ForceDescendIntoIfVisible()) return; if (f->ForceDescendIntoIfVisible()) return;
f->SetForceDescendIntoIfVisible(true); f->SetForceDescendIntoIfVisible(true);
CRR_LOG("Considering OOFs for %p\n", f); CRR_LOG("Considering OOFs for %p\n", f);

View file

@ -3753,8 +3753,7 @@ nsCSSBorderImageRenderer::nsCSSBorderImageRenderer(
const auto& width = aStyleBorder.mBorderImageWidth.Get(s); const auto& width = aStyleBorder.mBorderImageWidth.Get(s);
switch (width.tag) { switch (width.tag) {
case StyleBorderImageSideWidth::Tag::LengthPercentage: case StyleBorderImageSideWidth::Tag::LengthPercentage:
value = value = std::max(0, width.AsLengthPercentage().Resolve(borderDimension));
std::max(0, width.AsLengthPercentage().Resolve(borderDimension));
break; break;
case StyleBorderImageSideWidth::Tag::Number: case StyleBorderImageSideWidth::Tag::Number:
value = width.AsNumber() * borderWidths.Side(s); value = width.AsNumber() * borderWidths.Side(s);

View file

@ -1153,7 +1153,8 @@ bool CustomCounterStyle::IsBullet() {
void CustomCounterStyle::GetNegative(NegativeType& aResult) { void CustomCounterStyle::GetNegative(NegativeType& aResult) {
if (!(mFlags & FLAG_NEGATIVE_INITED)) { if (!(mFlags & FLAG_NEGATIVE_INITED)) {
mFlags |= FLAG_NEGATIVE_INITED; mFlags |= FLAG_NEGATIVE_INITED;
if (!Servo_CounterStyleRule_GetNegative(mRule, &mNegative.before, if (!Servo_CounterStyleRule_GetNegative(mRule,
&mNegative.before,
&mNegative.after)) { &mNegative.after)) {
if (IsExtendsSystem()) { if (IsExtendsSystem()) {
GetExtends()->GetNegative(mNegative); GetExtends()->GetNegative(mNegative);

View file

@ -315,7 +315,8 @@ void FontFace::SetDisplay(const nsAString& aValue, ErrorResult& aRv) {
} }
} }
void FontFace::DescriptorUpdated() { void FontFace::DescriptorUpdated()
{
// If we haven't yet initialized mUserFontEntry, no need to do anything here; // If we haven't yet initialized mUserFontEntry, no need to do anything here;
// we'll respect the updated descriptor when the time comes to create it. // we'll respect the updated descriptor when the time comes to create it.
if (!mUserFontEntry) { if (!mUserFontEntry) {

View file

@ -1032,9 +1032,10 @@ FontFaceSet::FindOrCreateUserFontEntryFromFontFace(
if (existingEntry) { if (existingEntry) {
// aFontFace already has a user font entry, so we update its attributes // aFontFace already has a user font entry, so we update its attributes
// rather than creating a new one. // rather than creating a new one.
existingEntry->UpdateAttributes( existingEntry->UpdateAttributes(weight, stretch, italicStyle,
weight, stretch, italicStyle, featureSettings, variationSettings, featureSettings, variationSettings,
languageOverride, unicodeRanges, fontDisplay, rangeFlags); languageOverride, unicodeRanges,
fontDisplay, rangeFlags);
// If the family name has changed, remove the entry from its current family // If the family name has changed, remove the entry from its current family
// and clear the mFamilyName field so it can be reset when added to a new // and clear the mFamilyName field so it can be reset when added to a new
// family. // family.

View file

@ -171,8 +171,7 @@ enum class StyleScrollbarWidth : uint8_t {
// Shape source type // Shape source type
enum class StyleShapeSourceType : uint8_t { enum class StyleShapeSourceType : uint8_t {
None, None,
Image, // shape-outside / clip-path only, and clip-path only uses it for Image, // shape-outside / clip-path only, and clip-path only uses it for <url>s
// <url>s
Shape, Shape,
Box, Box,
Path, // SVG path function Path, // SVG path function

View file

@ -29,7 +29,7 @@ class FontSlantStyle;
namespace dom { namespace dom {
class Document; class Document;
class Element; class Element;
} // namespace dom }
} // namespace mozilla } // namespace mozilla
// Style utility functions // Style utility functions

View file

@ -55,13 +55,11 @@ void SVGImageContext::MaybeStoreContextPaint(Maybe<SVGImageContext>& aContext,
haveContextPaint = true; haveContextPaint = true;
contextPaint->SetStroke(style->mStroke.GetColor(aFromComputedStyle)); contextPaint->SetStroke(style->mStroke.GetColor(aFromComputedStyle));
} }
if (style->mMozContextProperties.bits & if (style->mMozContextProperties.bits & StyleContextPropertyBits_FILL_OPACITY) {
StyleContextPropertyBits_FILL_OPACITY) {
haveContextPaint = true; haveContextPaint = true;
contextPaint->SetFillOpacity(style->mFillOpacity); contextPaint->SetFillOpacity(style->mFillOpacity);
} }
if (style->mMozContextProperties.bits & if (style->mMozContextProperties.bits & StyleContextPropertyBits_STROKE_OPACITY) {
StyleContextPropertyBits_STROKE_OPACITY) {
haveContextPaint = true; haveContextPaint = true;
contextPaint->SetStrokeOpacity(style->mStrokeOpacity); contextPaint->SetStrokeOpacity(style->mStrokeOpacity);
} }

View file

@ -1174,8 +1174,7 @@ static nsSVGPaintingProperty* GetOrCreateClipPathObserver(
if (svgStyleReset->mClipPath.GetType() != StyleShapeSourceType::Image) { if (svgStyleReset->mClipPath.GetType() != StyleShapeSourceType::Image) {
return nullptr; return nullptr;
} }
const css::URLValue* url = const css::URLValue* url = svgStyleReset->mClipPath.ShapeImage().GetURLValue();
svgStyleReset->mClipPath.ShapeImage().GetURLValue();
MOZ_ASSERT(url); MOZ_ASSERT(url);
RefPtr<URLAndReferrerInfo> pathURI = RefPtr<URLAndReferrerInfo> pathURI =
ResolveURLUsingLocalRef(aClippedFrame, url); ResolveURLUsingLocalRef(aClippedFrame, url);

View file

@ -240,8 +240,8 @@ void nsTableRowGroupFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
DisplayOutsetBoxShadow(aBuilder, aLists.BorderBackground()); DisplayOutsetBoxShadow(aBuilder, aLists.BorderBackground());
for (nsTableRowFrame* row = GetFirstRow(); row; row = row->GetNextRow()) { for (nsTableRowFrame* row = GetFirstRow(); row; row = row->GetNextRow()) {
if (!aBuilder->GetDirtyRect().Intersects(row->GetVisualOverflowRect() + if (!aBuilder->GetDirtyRect().Intersects(
row->GetNormalPosition())) { row->GetVisualOverflowRect() + row->GetNormalPosition())) {
continue; continue;
} }
row->PaintCellBackgroundsForFrame(this, aBuilder, aLists, row->PaintCellBackgroundsForFrame(this, aBuilder, aLists,

View file

@ -1618,6 +1618,7 @@ class HashTable : private AllocPolicy {
static char* createTable(AllocPolicy& aAllocPolicy, uint32_t aCapacity, static char* createTable(AllocPolicy& aAllocPolicy, uint32_t aCapacity,
FailureBehavior aReportFailure = ReportFailure) { FailureBehavior aReportFailure = ReportFailure) {
FakeSlot* fake = FakeSlot* fake =
aReportFailure aReportFailure
? aAllocPolicy.template pod_malloc<FakeSlot>(aCapacity) ? aAllocPolicy.template pod_malloc<FakeSlot>(aCapacity)

View file

@ -45,41 +45,42 @@ namespace recordreplay {
(JSContext * aCx, JSObject * aObj), (aCx, aObj)) (JSContext * aCx, JSObject * aObj), (aCx, aObj))
#define FOR_EACH_INTERFACE_VOID(Macro) \ #define FOR_EACH_INTERFACE_VOID(Macro) \
Macro(InternalBeginOrderedAtomicAccess, (const void* aValue), \
(aValue)) Macro(InternalEndOrderedAtomicAccess, (), ()) \
Macro(InternalBeginPassThroughThreadEvents, (), ()) Macro( \
InternalEndPassThroughThreadEvents, (), \
()) Macro(InternalBeginDisallowThreadEvents, (), \
()) Macro(InternalEndDisallowThreadEvents, (), \
()) Macro(InternalRecordReplayBytes, \
(void* aData, size_t aSize), \
(aData, aSize)) \
Macro( \ Macro( \
InternalInvalidateRecording, (const char* aWhy), \ InternalBeginOrderedAtomicAccess, (const void* aValue), \
(aWhy)) Macro(InternalDestroyPLDHashTableCallbacks, \ (aValue)) Macro(InternalEndOrderedAtomicAccess, (), \
()) Macro(InternalBeginPassThroughThreadEvents, (), \
()) Macro(InternalEndPassThroughThreadEvents, \
(), ()) \
Macro(InternalBeginDisallowThreadEvents, (), ()) Macro( \
InternalEndDisallowThreadEvents, (), \
()) Macro(InternalRecordReplayBytes, (void* aData, size_t aSize), \
(aData, aSize)) Macro(InternalInvalidateRecording, \
(const char* aWhy), (aWhy)) \
Macro(InternalDestroyPLDHashTableCallbacks, \
(const PLDHashTableOps* aOps), \ (const PLDHashTableOps* aOps), \
(aOps)) Macro(InternalMovePLDHashTableContents, \ (aOps)) Macro(InternalMovePLDHashTableContents, \
(const PLDHashTableOps* aFirstOps, \ (const PLDHashTableOps* aFirstOps, \
const PLDHashTableOps* aSecondOps), \ const PLDHashTableOps* aSecondOps), \
(aFirstOps, aSecondOps)) \ (aFirstOps, \
Macro(SetWeakPointerJSRoot, \ aSecondOps)) Macro(SetWeakPointerJSRoot, \
(const void* aPtr, JSObject* aJSObj), (aPtr, aJSObj)) \ (const void* aPtr, \
JSObject* aJSObj), \
(aPtr, aJSObj)) \
Macro(RegisterTrigger, \ Macro(RegisterTrigger, \
(void* aObj, const std::function<void()>& aCallback), \ (void* aObj, const std::function<void()>& aCallback), \
(aObj, \ (aObj, aCallback)) Macro(UnregisterTrigger, (void* aObj), \
aCallback)) Macro(UnregisterTrigger, (void* aObj), \ (aObj)) \
(aObj)) Macro(ActivateTrigger, \ Macro(ActivateTrigger, (void* aObj), (aObj)) Macro( \
(void* aObj), (aObj)) \ ExecuteTriggers, (), \
Macro(ExecuteTriggers, (), ()) Macro( \ ()) Macro(InternalRecordReplayAssert, \
InternalRecordReplayAssert, \
(const char* aFormat, va_list aArgs), \ (const char* aFormat, va_list aArgs), \
(aFormat, \ (aFormat, aArgs)) \
aArgs)) Macro(InternalRecordReplayAssertBytes, \ Macro(InternalRecordReplayAssertBytes, \
(const void* aData, size_t aSize), \ (const void* aData, size_t aSize), \
(aData, aSize)) \ (aData, aSize)) Macro(InternalRegisterThing, \
Macro(InternalRegisterThing, (void* aThing), \
(aThing)) Macro(InternalUnregisterThing, \
(void* aThing), (aThing)) \ (void* aThing), (aThing)) \
Macro(InternalUnregisterThing, (void* aThing), \
(aThing)) \
Macro(BeginContentParse, \ Macro(BeginContentParse, \
(const void* aToken, const char* aURL, \ (const void* aToken, const char* aURL, \
const char* aContentType), \ const char* aContentType), \

View file

@ -326,8 +326,8 @@ bool SignedBinary::VerifySignature(const wchar_t* aFilePath) {
// We can't use UniquePtr for this because the deleter function requires two // We can't use UniquePtr for this because the deleter function requires two
// parameters. // parameters.
auto cleanCatInfoHdl = auto cleanCatInfoHdl = mozilla::MakeScopeExit(
mozilla::MakeScopeExit([rawCatAdmin, catInfoHdl]() -> void { [rawCatAdmin, catInfoHdl]() -> void {
pCryptCATAdminReleaseCatalogContext(rawCatAdmin, catInfoHdl, 0); pCryptCATAdminReleaseCatalogContext(rawCatAdmin, catInfoHdl, 0);
}); });

View file

@ -832,10 +832,7 @@ extern "C" int wmain(int argc, wchar_t* argv[]) {
#endif #endif
TEST_DETOUR_SKIP_EXEC(kernel32.dll, BaseThreadInitThunk) && TEST_DETOUR_SKIP_EXEC(kernel32.dll, BaseThreadInitThunk) &&
TEST_DETOUR_SKIP_EXEC(ntdll.dll, LdrLoadDll) && TEST_DETOUR_SKIP_EXEC(ntdll.dll, LdrLoadDll) &&
MAYBE_TEST_HOOK_PARAMS(HasApiSetQueryApiSetPresence(), MAYBE_TEST_HOOK_PARAMS(HasApiSetQueryApiSetPresence(), Api-ms-win-core-apiquery-l1-1-0.dll, ApiSetQueryApiSetPresence, Equals, FALSE, &gEmptyUnicodeString, &gIsPresent) &&
Api - ms - win - core - apiquery - l1 - 1 - 0.dll,
ApiSetQueryApiSetPresence, Equals, FALSE,
&gEmptyUnicodeString, &gIsPresent) &&
TestTenByteDetour()) { TestTenByteDetour()) {
printf("TEST-PASS | WindowsDllInterceptor | all checks passed\n"); printf("TEST-PASS | WindowsDllInterceptor | all checks passed\n");

View file

@ -75,12 +75,8 @@ class AltSvcMapping;
* FRAMECHECK_STRICT - we also do not allow case 2) and 3) from * FRAMECHECK_STRICT - we also do not allow case 2) and 3) from
* FRAMECHECK_BARELY. * FRAMECHECK_BARELY.
*/ */
enum FrameCheckLevel { enum FrameCheckLevel { FRAMECHECK_LAX, FRAMECHECK_BARELY,
FRAMECHECK_LAX, FRAMECHECK_STRICT_CHUNKED, FRAMECHECK_STRICT };
FRAMECHECK_BARELY,
FRAMECHECK_STRICT_CHUNKED,
FRAMECHECK_STRICT
};
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// nsHttpHandler - protocol handler for HTTP and HTTPS // nsHttpHandler - protocol handler for HTTP and HTTPS

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