зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central to mozilla-inbound
This commit is contained in:
Коммит
d561628a63
|
@ -329,14 +329,18 @@ bool
|
|||
nsTextEquivUtils::AppendString(nsAString *aString,
|
||||
const nsAString& aTextEquivalent)
|
||||
{
|
||||
// Insert spaces to insure that words from controls aren't jammed together.
|
||||
if (aTextEquivalent.IsEmpty())
|
||||
return false;
|
||||
|
||||
if (!aString->IsEmpty())
|
||||
// Insert spaces to insure that words from controls aren't jammed together.
|
||||
if (!aString->IsEmpty() && !IsWhitespace(aString->Last()))
|
||||
aString->Append(PRUnichar(' '));
|
||||
|
||||
aString->Append(aTextEquivalent);
|
||||
|
||||
if (!IsWhitespace(aString->Last()))
|
||||
aString->Append(PRUnichar(' '));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -91,6 +91,9 @@
|
|||
// Gets the name from html:input value, ignore @title attribute on input
|
||||
testName("from_input_ignoretitle", "Custom country");
|
||||
|
||||
// Insert spaces around the control's value to not jamm sibling text nodes
|
||||
testName("insert_spaces_around_control", "start value end");
|
||||
|
||||
// Gets the name from @title, ignore whitespace content
|
||||
testName("from_label_ignore_ws_subtree", "about");
|
||||
|
||||
|
@ -262,6 +265,11 @@
|
|||
title="ARIA slider and spinbutton don't provide a value for name computation">
|
||||
Bug 812041
|
||||
</a>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=823927"
|
||||
title="Text is jammed with control's text in name computation">
|
||||
Bug 823927
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
|
@ -389,6 +397,11 @@
|
|||
value="Custom country"
|
||||
title="Input your country of origin"/ >
|
||||
|
||||
<!-- name from subtree, surround control by spaces to not jamm the text -->
|
||||
<label id="insert_spaces_around_control">
|
||||
start<input value="value">end
|
||||
</label>
|
||||
|
||||
<!-- no name from subtree because it holds whitespaces only -->
|
||||
<a id="from_label_ignore_ws_subtree" href="about:" title="about"> </a>
|
||||
|
||||
|
|
|
@ -174,8 +174,6 @@ pref("content.sink.perf_parse_time", 50000000);
|
|||
|
||||
// Maximum scripts runtime before showing an alert
|
||||
pref("dom.max_chrome_script_run_time", 0); // disable slow script dialog for chrome
|
||||
// Bug 817230 - disable the dialog until we implement its checkbox properly
|
||||
pref("dom.max_script_run_time", 0);
|
||||
|
||||
// plugins
|
||||
pref("plugin.disable", true);
|
||||
|
|
|
@ -2162,9 +2162,9 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
|
|||
}
|
||||
|
||||
@media (min-resolution: 2dppx) {
|
||||
.tab-throbber,
|
||||
.tab-icon-image {
|
||||
list-style-image: url("chrome://mozapps/skin/places/defaultFavicon@2x.png");
|
||||
image-rendering: -moz-crisp-edges;
|
||||
}
|
||||
|
||||
.tab-throbber {
|
||||
|
@ -2174,10 +2174,6 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
|
|||
.tab-throbber[progress] {
|
||||
list-style-image: url("chrome://browser/skin/tabbrowser/loading@2x.png");
|
||||
}
|
||||
|
||||
.tab-icon-image {
|
||||
image-rendering: -moz-crisp-edges;
|
||||
}
|
||||
}
|
||||
|
||||
.tabbrowser-tab:not(:hover) > .tab-stack > .tab-content > .tab-icon-image:not([selected="true"]) {
|
||||
|
|
|
@ -14,6 +14,10 @@
|
|||
// No throwing exceptions
|
||||
#undef _STLP_NO_EXCEPTIONS
|
||||
#define _STLP_NO_EXCEPTIONS 1
|
||||
#undef _STLP_NO_EXCEPTION_HEADER
|
||||
#define _STLP_NO_EXCEPTION_HEADER 1
|
||||
#undef _STLP_NO_UNCAUGHT_EXCEPT_SUPPORT
|
||||
#define _STLP_NO_UNCAUGHT_EXCEPT_SUPPORT 1
|
||||
|
||||
#undef _STLP_NATIVE_CPP_C_HEADER
|
||||
#define _STLP_NATIVE_CPP_C_HEADER(header) <../../system/include/header>
|
||||
|
|
|
@ -425,7 +425,3 @@ DOMCI_CLASS(MozTimeManager)
|
|||
#ifdef MOZ_WEBRTC
|
||||
DOMCI_CLASS(DataChannel)
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_AUDIO_CHANNEL_MANAGER
|
||||
DOMCI_CLASS(AudioChannelManager)
|
||||
#endif
|
||||
|
|
|
@ -133,6 +133,9 @@ static PRLogModuleInfo* gJSDiagnostics;
|
|||
|
||||
#define JAVASCRIPT nsIProgrammingLanguage::JAVASCRIPT
|
||||
|
||||
// Large value used to specify that a script should run essentially forever
|
||||
#define NS_UNLIMITED_SCRIPT_RUNTIME (0x40000000LL << 32)
|
||||
|
||||
// if you add statics here, add them to the list in nsJSRuntime::Startup
|
||||
|
||||
static nsITimer *sGCTimer;
|
||||
|
@ -886,8 +889,13 @@ nsJSContext::DOMOperationCallback(JSContext *cx)
|
|||
// Allow the script to continue running
|
||||
|
||||
if (neverShowDlgChk) {
|
||||
Preferences::SetInt(isTrackingChromeCodeTime ?
|
||||
"dom.max_chrome_script_run_time" : "dom.max_script_run_time", 0);
|
||||
if (isTrackingChromeCodeTime) {
|
||||
Preferences::SetInt("dom.max_chrome_script_run_time", 0);
|
||||
sMaxChromeScriptRunTime = NS_UNLIMITED_SCRIPT_RUNTIME;
|
||||
} else {
|
||||
Preferences::SetInt("dom.max_script_run_time", 0);
|
||||
sMaxScriptRunTime = NS_UNLIMITED_SCRIPT_RUNTIME;
|
||||
}
|
||||
}
|
||||
|
||||
ctx->mOperationCallbackTime = PR_Now();
|
||||
|
@ -3377,8 +3385,7 @@ MaxScriptRunTimePrefChangedCallback(const char *aPrefName, void *aClosure)
|
|||
|
||||
PRTime t;
|
||||
if (time <= 0) {
|
||||
// Let scripts run for a really, really long time.
|
||||
t = 0x40000000LL << 32;
|
||||
t = NS_UNLIMITED_SCRIPT_RUNTIME;
|
||||
} else {
|
||||
t = time * PR_USEC_PER_SEC;
|
||||
}
|
||||
|
|
|
@ -52,6 +52,7 @@ public:
|
|||
, mCurrentTaskIsCanceled(false)
|
||||
, mTask(nullptr)
|
||||
, mAddress(aAddress)
|
||||
, mLock("UnixSocketImpl.mLock")
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -75,14 +76,16 @@ public:
|
|||
|
||||
void CancelTask()
|
||||
{
|
||||
if (!mTask) {
|
||||
return;
|
||||
}
|
||||
mTask->Cancel();
|
||||
mTask = nullptr;
|
||||
MutexAutoLock lock(mLock);
|
||||
mCurrentTaskIsCanceled = true;
|
||||
}
|
||||
|
||||
bool IsCanceled()
|
||||
{
|
||||
MutexAutoLock lock(mLock);
|
||||
return mCurrentTaskIsCanceled;
|
||||
}
|
||||
|
||||
void UnsetTask()
|
||||
{
|
||||
mTask = nullptr;
|
||||
|
@ -98,7 +101,7 @@ public:
|
|||
if (mTask) {
|
||||
return;
|
||||
}
|
||||
if (mCurrentTaskIsCanceled) {
|
||||
if (IsCanceled()) {
|
||||
return;
|
||||
}
|
||||
mTask = aTask;
|
||||
|
@ -136,6 +139,11 @@ public:
|
|||
void Accept();
|
||||
|
||||
/**
|
||||
* Close an open connection
|
||||
*/
|
||||
void Close();
|
||||
|
||||
/**
|
||||
* Stop whatever connect/accept task is running
|
||||
*/
|
||||
void StopTask()
|
||||
|
@ -144,6 +152,7 @@ public:
|
|||
mTask->Cancel();
|
||||
mTask = nullptr;
|
||||
}
|
||||
MutexAutoLock lock(mLock);
|
||||
mCurrentTaskIsCanceled = true;
|
||||
}
|
||||
|
||||
|
@ -252,6 +261,10 @@ private:
|
|||
*/
|
||||
sockaddr mAddr;
|
||||
|
||||
/**
|
||||
* Protects mCurrentTaskIsCanceled
|
||||
*/
|
||||
mozilla::Mutex mLock;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
|
@ -365,7 +378,7 @@ private:
|
|||
UnixSocketRawData* mData;
|
||||
};
|
||||
|
||||
class SocketCloseTask : public nsRunnable
|
||||
class SocketCloseTask : public Task
|
||||
{
|
||||
public:
|
||||
SocketCloseTask(UnixSocketImpl* aImpl)
|
||||
|
@ -374,11 +387,12 @@ public:
|
|||
MOZ_ASSERT(aImpl);
|
||||
}
|
||||
|
||||
NS_IMETHOD
|
||||
Run()
|
||||
void Run()
|
||||
{
|
||||
mImpl->mConsumer->CloseSocket();
|
||||
return NS_OK;
|
||||
NS_ENSURE_TRUE_VOID(mImpl);
|
||||
|
||||
mImpl->UnsetTask();
|
||||
mImpl->Close();
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -438,6 +452,19 @@ void SocketConnectTask::Run() {
|
|||
mImpl->Connect();
|
||||
}
|
||||
|
||||
void
|
||||
UnixSocketImpl::Close()
|
||||
{
|
||||
mReadWatcher.StopWatchingFileDescriptor();
|
||||
mWriteWatcher.StopWatchingFileDescriptor();
|
||||
|
||||
nsRefPtr<nsIRunnable> t(new DeleteInstanceRunnable<UnixSocketImpl>(this));
|
||||
NS_ENSURE_TRUE_VOID(t);
|
||||
|
||||
nsresult rv = NS_DispatchToMainThread(t);
|
||||
NS_ENSURE_SUCCESS_VOID(rv);
|
||||
}
|
||||
|
||||
void
|
||||
UnixSocketImpl::Accept()
|
||||
{
|
||||
|
@ -478,28 +505,7 @@ UnixSocketImpl::Accept()
|
|||
|
||||
}
|
||||
|
||||
int client_fd;
|
||||
client_fd = accept(mFd.get(), &mAddr, &mAddrSize);
|
||||
if (client_fd < 0) {
|
||||
EnqueueTask(SOCKET_RETRY_TIME_MS, new SocketAcceptTask(this));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mConnector->SetUp(client_fd)) {
|
||||
NS_WARNING("Could not set up socket!");
|
||||
return;
|
||||
}
|
||||
mFd.reset(client_fd);
|
||||
|
||||
nsRefPtr<OnSocketEventTask> t =
|
||||
new OnSocketEventTask(this, OnSocketEventTask::CONNECT_SUCCESS);
|
||||
NS_DispatchToMainThread(t);
|
||||
|
||||
// Due to the fact that we've dispatched our OnConnectSuccess message before
|
||||
// starting reading, we're guaranteed that any subsequent read tasks will
|
||||
// happen after the object has been notified of a successful connect.
|
||||
XRE_GetIOMessageLoop()->PostTask(FROM_HERE,
|
||||
new StartImplReadingTask(this));
|
||||
SetUpIO();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -564,11 +570,6 @@ UnixSocketImpl::SetNonblockFlags()
|
|||
return false;
|
||||
}
|
||||
|
||||
// Select non-blocking IO.
|
||||
if (-1 == fcntl(mFd, F_SETFL, O_NONBLOCK)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -624,18 +625,9 @@ UnixSocketConsumer::CloseSocket()
|
|||
mImpl = nullptr;
|
||||
// Line it up to be destructed on the IO Thread
|
||||
impl->mConsumer.forget();
|
||||
impl->StopTask();
|
||||
|
||||
// The receiver task should have been stopped at this point, but
|
||||
// SocketReceiverTask runnables might still be pending the main
|
||||
// thread. We enqueue the DeleteInstanceRunnable _after_ any pending
|
||||
// SocketReceiverTask. Otherwise we might free 'impl' before those
|
||||
// runnables have been executed.
|
||||
nsRefPtr<nsIRunnable> t(new DeleteInstanceRunnable<UnixSocketImpl>(impl));
|
||||
NS_ENSURE_TRUE_VOID(t);
|
||||
nsresult rv = NS_DispatchToMainThread(t);
|
||||
NS_ENSURE_SUCCESS_VOID(rv);
|
||||
t.forget();
|
||||
impl->CancelTask();
|
||||
XRE_GetIOMessageLoop()->PostTask(FROM_HERE, new SocketCloseTask(impl));
|
||||
|
||||
NotifyDisconnect();
|
||||
}
|
||||
|
@ -643,50 +635,81 @@ UnixSocketConsumer::CloseSocket()
|
|||
void
|
||||
UnixSocketImpl::OnFileCanReadWithoutBlocking(int aFd)
|
||||
{
|
||||
// Keep reading data until either
|
||||
//
|
||||
// - mIncoming is completely read
|
||||
// If so, sConsumer->MessageReceived(mIncoming.forget())
|
||||
//
|
||||
// - mIncoming isn't completely read, but there's no more
|
||||
// data available on the socket
|
||||
// If so, break;
|
||||
while (true) {
|
||||
if (!mIncoming) {
|
||||
uint8_t data[MAX_READ_SIZE];
|
||||
ssize_t ret = read(aFd, data, MAX_READ_SIZE);
|
||||
if (ret < 0) {
|
||||
if (ret == -1) {
|
||||
if (errno == EINTR) {
|
||||
continue; // retry system call when interrupted
|
||||
enum SocketConnectionStatus status = mConsumer->GetConnectionStatus();
|
||||
|
||||
if (status == SOCKET_CONNECTED) {
|
||||
|
||||
// Keep reading data until either
|
||||
//
|
||||
// - mIncoming is completely read
|
||||
// If so, sConsumer->MessageReceived(mIncoming.forget())
|
||||
//
|
||||
// - mIncoming isn't completely read, but there's no more
|
||||
// data available on the socket
|
||||
// If so, break;
|
||||
while (true) {
|
||||
if (!mIncoming) {
|
||||
uint8_t data[MAX_READ_SIZE];
|
||||
ssize_t ret = read(aFd, data, MAX_READ_SIZE);
|
||||
if (ret < 0) {
|
||||
if (ret == -1) {
|
||||
if (errno == EINTR) {
|
||||
continue; // retry system call when interrupted
|
||||
}
|
||||
else if (errno == EAGAIN || errno == EWOULDBLOCK) {
|
||||
return; // no data available: return and re-poll
|
||||
}
|
||||
// else fall through to error handling on other errno's
|
||||
}
|
||||
else if (errno == EAGAIN || errno == EWOULDBLOCK) {
|
||||
return; // no data available: return and re-poll
|
||||
}
|
||||
// else fall through to error handling on other errno's
|
||||
}
|
||||
#ifdef DEBUG
|
||||
NS_WARNING("Cannot read from network");
|
||||
NS_WARNING("Cannot read from network");
|
||||
#endif
|
||||
// At this point, assume that we can't actually access
|
||||
// the socket anymore
|
||||
mReadWatcher.StopWatchingFileDescriptor();
|
||||
mWriteWatcher.StopWatchingFileDescriptor();
|
||||
nsRefPtr<SocketCloseTask> t = new SocketCloseTask(this);
|
||||
NS_DispatchToMainThread(t);
|
||||
return;
|
||||
}
|
||||
if (ret) {
|
||||
mIncoming = new UnixSocketRawData(ret);
|
||||
memcpy(mIncoming->mData, data, ret);
|
||||
nsRefPtr<SocketReceiveTask> t =
|
||||
new SocketReceiveTask(this, mIncoming.forget());
|
||||
NS_DispatchToMainThread(t);
|
||||
}
|
||||
if (ret < ssize_t(MAX_READ_SIZE)) {
|
||||
return;
|
||||
// At this point, assume that we can't actually access
|
||||
// the socket anymore
|
||||
mReadWatcher.StopWatchingFileDescriptor();
|
||||
mWriteWatcher.StopWatchingFileDescriptor();
|
||||
XRE_GetIOMessageLoop()->PostTask(FROM_HERE, new SocketCloseTask(this));
|
||||
return;
|
||||
}
|
||||
if (ret) {
|
||||
mIncoming = new UnixSocketRawData(ret);
|
||||
memcpy(mIncoming->mData, data, ret);
|
||||
nsRefPtr<SocketReceiveTask> t =
|
||||
new SocketReceiveTask(this, mIncoming.forget());
|
||||
NS_DispatchToMainThread(t);
|
||||
}
|
||||
if (ret < ssize_t(MAX_READ_SIZE)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (status == SOCKET_LISTENING) {
|
||||
|
||||
int client_fd = accept(mFd.get(), &mAddr, &mAddrSize);
|
||||
|
||||
if (client_fd < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mConnector->SetUp(client_fd)) {
|
||||
NS_WARNING("Could not set up socket!");
|
||||
return;
|
||||
}
|
||||
|
||||
mReadWatcher.StopWatchingFileDescriptor();
|
||||
mWriteWatcher.StopWatchingFileDescriptor();
|
||||
|
||||
mFd.reset(client_fd);
|
||||
|
||||
nsRefPtr<OnSocketEventTask> t =
|
||||
new OnSocketEventTask(this, OnSocketEventTask::CONNECT_SUCCESS);
|
||||
NS_DispatchToMainThread(t);
|
||||
|
||||
// Due to the fact that we've dispatched our OnConnectSuccess message before
|
||||
// starting reading, we're guaranteed that any subsequent read tasks will
|
||||
// happen after the object has been notified of a successful connect.
|
||||
XRE_GetIOMessageLoop()->PostTask(FROM_HERE,
|
||||
new StartImplReadingTask(this));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -785,12 +808,12 @@ UnixSocketConsumer::ConnectSocket(UnixSocketConnector* aConnector,
|
|||
addr.Assign(aAddress);
|
||||
mImpl = new UnixSocketImpl(this, aConnector, addr);
|
||||
MessageLoop* ioLoop = XRE_GetIOMessageLoop();
|
||||
mConnectionStatus = SOCKET_CONNECTING;
|
||||
if (aDelayMs > 0) {
|
||||
ioLoop->PostDelayedTask(FROM_HERE, new SocketConnectTask(mImpl), aDelayMs);
|
||||
} else {
|
||||
ioLoop->PostTask(FROM_HERE, new SocketConnectTask(mImpl));
|
||||
}
|
||||
mConnectionStatus = SOCKET_CONNECTING;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -805,9 +828,9 @@ UnixSocketConsumer::ListenSocket(UnixSocketConnector* aConnector)
|
|||
}
|
||||
nsCString addr;
|
||||
mImpl = new UnixSocketImpl(this, aConnector, addr);
|
||||
mConnectionStatus = SOCKET_LISTENING;
|
||||
XRE_GetIOMessageLoop()->PostTask(FROM_HERE,
|
||||
new SocketAcceptTask(mImpl));
|
||||
mConnectionStatus = SOCKET_LISTENING;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -819,7 +842,7 @@ UnixSocketConsumer::CancelSocketTask()
|
|||
NS_WARNING("No socket implementation to cancel task on!");
|
||||
return;
|
||||
}
|
||||
mImpl->CancelTask();
|
||||
mImpl->StopTask();
|
||||
}
|
||||
|
||||
} // namespace ipc
|
||||
|
|
|
@ -2867,6 +2867,14 @@ IonBuilder::inlineScriptedCall(HandleFunction target, CallInfo &callInfo)
|
|||
return false;
|
||||
}
|
||||
|
||||
// Create new |this| on the caller-side for inlined constructors.
|
||||
if (callInfo.constructing()) {
|
||||
MDefinition *thisDefn = createThis(target, callInfo.fun());
|
||||
if (!thisDefn)
|
||||
return false;
|
||||
callInfo.setThis(thisDefn);
|
||||
}
|
||||
|
||||
// Push formals to capture in the resumepoint
|
||||
callInfo.pushFormals(current);
|
||||
|
||||
|
@ -2898,14 +2906,6 @@ IonBuilder::inlineScriptedCall(HandleFunction target, CallInfo &callInfo)
|
|||
IonBuilder inlineBuilder(cx, &temp(), &graph(), &oracle,
|
||||
info, inliningDepth + 1, loopDepth_);
|
||||
|
||||
// Create new |this| on the caller-side for inlined constructors.
|
||||
if (callInfo.constructing()) {
|
||||
MDefinition *thisDefn = createThis(target, callInfo.fun());
|
||||
if (!thisDefn)
|
||||
return false;
|
||||
callInfo.setThis(thisDefn);
|
||||
}
|
||||
|
||||
// Build the graph.
|
||||
if (!inlineBuilder.buildInline(this, resumePoint, callInfo)) {
|
||||
JS_ASSERT(calleeScript->hasAnalysis());
|
||||
|
|
|
@ -1218,7 +1218,7 @@ class MParBailout : public MAryControlInstruction<0, 0>
|
|||
INSTRUCTION_HEADER(ParBailout);
|
||||
|
||||
MParBailout()
|
||||
: MAryControlInstruction()
|
||||
: MAryControlInstruction<0, 0>()
|
||||
{
|
||||
setResultType(MIRType_Undefined);
|
||||
setGuard();
|
||||
|
|
|
@ -195,30 +195,23 @@ static const AllocKind FinalizePhaseIonCode[] = {
|
|||
FINALIZE_IONCODE
|
||||
};
|
||||
|
||||
static const AllocKind FinalizePhaseShapes[] = {
|
||||
FINALIZE_TYPE_OBJECT
|
||||
};
|
||||
|
||||
static const AllocKind* FinalizePhases[] = {
|
||||
FinalizePhaseStrings,
|
||||
FinalizePhaseScripts,
|
||||
FinalizePhaseIonCode,
|
||||
FinalizePhaseShapes
|
||||
FinalizePhaseIonCode
|
||||
};
|
||||
static const int FinalizePhaseCount = sizeof(FinalizePhases) / sizeof(AllocKind*);
|
||||
|
||||
static const int FinalizePhaseLength[] = {
|
||||
sizeof(FinalizePhaseStrings) / sizeof(AllocKind),
|
||||
sizeof(FinalizePhaseScripts) / sizeof(AllocKind),
|
||||
sizeof(FinalizePhaseIonCode) / sizeof(AllocKind),
|
||||
sizeof(FinalizePhaseShapes) / sizeof(AllocKind)
|
||||
sizeof(FinalizePhaseIonCode) / sizeof(AllocKind)
|
||||
};
|
||||
|
||||
static const gcstats::Phase FinalizePhaseStatsPhase[] = {
|
||||
gcstats::PHASE_SWEEP_STRING,
|
||||
gcstats::PHASE_SWEEP_SCRIPT,
|
||||
gcstats::PHASE_SWEEP_IONCODE,
|
||||
gcstats::PHASE_SWEEP_SHAPE
|
||||
gcstats::PHASE_SWEEP_IONCODE
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -241,7 +234,8 @@ static const AllocKind BackgroundPhaseStrings[] = {
|
|||
|
||||
static const AllocKind BackgroundPhaseShapes[] = {
|
||||
FINALIZE_SHAPE,
|
||||
FINALIZE_BASE_SHAPE
|
||||
FINALIZE_BASE_SHAPE,
|
||||
FINALIZE_TYPE_OBJECT
|
||||
};
|
||||
|
||||
static const AllocKind* BackgroundPhases[] = {
|
||||
|
@ -1480,10 +1474,9 @@ ArenaLists::queueShapesForSweep(FreeOp *fop)
|
|||
{
|
||||
gcstats::AutoPhase ap(fop->runtime()->gcStats, gcstats::PHASE_SWEEP_SHAPE);
|
||||
|
||||
queueForForegroundSweep(fop, FINALIZE_TYPE_OBJECT);
|
||||
|
||||
queueForBackgroundSweep(fop, FINALIZE_SHAPE);
|
||||
queueForBackgroundSweep(fop, FINALIZE_BASE_SHAPE);
|
||||
queueForBackgroundSweep(fop, FINALIZE_TYPE_OBJECT);
|
||||
}
|
||||
|
||||
static void *
|
||||
|
@ -4588,6 +4581,12 @@ JS::ShrinkGCBuffers(JSRuntime *rt)
|
|||
rt->gcHelperThread.startBackgroundShrink();
|
||||
}
|
||||
|
||||
void
|
||||
js::gc::FinishBackgroundFinalize(JSRuntime *rt)
|
||||
{
|
||||
rt->gcHelperThread.waitBackgroundSweepEnd();
|
||||
}
|
||||
|
||||
AutoFinishGC::AutoFinishGC(JSRuntime *rt)
|
||||
{
|
||||
if (IsIncrementalGCInProgress(rt)) {
|
||||
|
@ -4595,7 +4594,7 @@ AutoFinishGC::AutoFinishGC(JSRuntime *rt)
|
|||
FinishIncrementalGC(rt, gcreason::API);
|
||||
}
|
||||
|
||||
rt->gcHelperThread.waitBackgroundSweepEnd();
|
||||
gc::FinishBackgroundFinalize(rt);
|
||||
}
|
||||
|
||||
AutoPrepareForTracing::AutoPrepareForTracing(JSRuntime *rt)
|
||||
|
|
|
@ -168,8 +168,8 @@ IsBackgroundFinalized(AllocKind kind)
|
|||
true, /* FINALIZE_OBJECT16_BACKGROUND */
|
||||
false, /* FINALIZE_SCRIPT */
|
||||
true, /* FINALIZE_SHAPE */
|
||||
true, /* FINALIZE_BASE_SHAPE */
|
||||
false, /* FINALIZE_TYPE_OBJECT */
|
||||
true, /* FINALIZE_BASE_SHAPE */
|
||||
true, /* FINALIZE_TYPE_OBJECT */
|
||||
true, /* FINALIZE_SHORT_STRING */
|
||||
true, /* FINALIZE_STRING */
|
||||
false, /* FINALIZE_EXTERNAL_STRING */
|
||||
|
@ -334,6 +334,10 @@ struct ArenaLists {
|
|||
backgroundFinalizeState[kind] == BFS_JUST_FINISHED;
|
||||
}
|
||||
|
||||
bool needBackgroundFinalizeWait(AllocKind kind) const {
|
||||
return backgroundFinalizeState[kind] != BFS_DONE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the free list back to the arena so the GC finalization will not
|
||||
* run the finalizers over unitialized bytes from free things.
|
||||
|
@ -1185,6 +1189,10 @@ SetDeterministicGC(JSContext *cx, bool enabled);
|
|||
void
|
||||
SetValidateGC(JSContext *cx, bool enabled);
|
||||
|
||||
/* Wait for the background thread to finish sweeping if it is running. */
|
||||
void
|
||||
FinishBackgroundFinalize(JSRuntime *rt);
|
||||
|
||||
const int ZealPokeValue = 1;
|
||||
const int ZealAllocValue = 2;
|
||||
const int ZealFrameGCValue = 3;
|
||||
|
|
|
@ -357,13 +357,18 @@ class CellIter : public CellIterImpl
|
|||
: lists(&comp->zone()->allocator.arenas),
|
||||
kind(kind)
|
||||
{
|
||||
|
||||
/*
|
||||
* We have a single-threaded runtime, so there's no need to protect
|
||||
* against other threads iterating or allocating. However, we do have
|
||||
* background finalization; make sure people aren't using CellIter to
|
||||
* walk such allocation kinds.
|
||||
* background finalization; we have to wait for this to finish if it's
|
||||
* currently active.
|
||||
*/
|
||||
JS_ASSERT(!IsBackgroundFinalized(kind));
|
||||
if (IsBackgroundFinalized(kind) &&
|
||||
comp->zone()->allocator.arenas.needBackgroundFinalizeWait(kind))
|
||||
{
|
||||
gc::FinishBackgroundFinalize(comp->rt);
|
||||
}
|
||||
if (lists->isSynchronizedFreeList(kind)) {
|
||||
lists = NULL;
|
||||
} else {
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#if defined(__cplusplus)
|
||||
#include "mozilla/fallible.h"
|
||||
#endif
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
#define MOZALLOC_HAVE_XMALLOC
|
||||
|
||||
|
|
|
@ -33,9 +33,7 @@
|
|||
* compilers are not guaranteed to respect it (although they're much more likely
|
||||
* to do so).
|
||||
*/
|
||||
#if defined(DEBUG)
|
||||
# define MOZ_ALWAYS_INLINE MOZ_INLINE
|
||||
#elif defined(_MSC_VER)
|
||||
#if defined(_MSC_VER)
|
||||
# define MOZ_ALWAYS_INLINE __forceinline
|
||||
#elif defined(__GNUC__)
|
||||
# define MOZ_ALWAYS_INLINE __attribute__((always_inline)) MOZ_INLINE
|
||||
|
|
|
@ -22,23 +22,18 @@ function test()
|
|||
if (pm.eventsMeasured == 0) {
|
||||
todo(false, "stub, skipping test");
|
||||
} else {
|
||||
is(pm.eventsMeasured, PerfMeasurement.ALL, "all events measurable");
|
||||
|
||||
pm.start();
|
||||
for (let i = 0; i < 10000; i++) ;
|
||||
pm.stop();
|
||||
|
||||
isnot(pm.cpu_cycles, -1, "cpu_cycles");
|
||||
isnot(pm.instructions, -1, "instructions");
|
||||
isnot(pm.cache_references, -1, "cache_references");
|
||||
isnot(pm.cache_misses, -1, "cache_misses");
|
||||
isnot(pm.branch_instructions, -1, "branch_instructions");
|
||||
isnot(pm.branch_misses, -1, "branch_misses");
|
||||
isnot(pm.bus_cycles, -1, "bus_cycles");
|
||||
isnot(pm.page_faults, -1, "page_faults");
|
||||
isnot(pm.major_page_faults, -1, "major_page_faults");
|
||||
isnot(pm.context_switches, -1, "context_switches");
|
||||
isnot(pm.cpu_migrations, -1, "cpu_migrations");
|
||||
events = ["cpu_cycles", "instructions", "cache_references", "cache_misses",
|
||||
"branch_instructions", "branch_misses", "bus_cycles", "page_faults",
|
||||
"major_page_faults", "context_switches", "cpu_migrations"];
|
||||
|
||||
for (var i = 0; i < events.length; i++) {
|
||||
var e = events[i];
|
||||
((pm.eventsMeasured & PerfMeasurement[e.toUpperCase()]) ? isnot : todo_is)(pm[e], -1, e);
|
||||
}
|
||||
}
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Extensions we recognize for DeviceStorage storage areas
|
||||
pictures=*.jpe; *.jpg; *.jpeg; *.gif; *.png; *.bmp;
|
||||
music=*.mp3; *.ogg; *.m4a; *.m4b; *.m4p; *.m4r; *.3gp; *.mp4; *.aac; *.m3u; *.pls;
|
||||
music=*.mp3; *.ogg; *.m4a; *.m4b; *.m4p; *.m4r; *.3gp; *.mp4; *.aac; *.m3u; *.pls; *.opus;
|
||||
videos=*.mp4; *.mpeg; *.mpg; *.ogv; *.ogx; *.webm; *.3gp; *.ogg;
|
||||
|
|
|
@ -14,16 +14,18 @@
|
|||
<script class="testbody" type="application/javascript"><![CDATA[
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
let win;
|
||||
var left = 60 + screen.availLeft;
|
||||
var upper = 60 + screen.availTop;
|
||||
|
||||
function runTest() {
|
||||
win = window.openDialog("window_screenPosSize.xul",
|
||||
null,
|
||||
"chrome,dialog=no,all,screenX=60,screenY=60,outerHeight=200,outerWidth=200");
|
||||
"chrome,dialog=no,all,screenX=" + left + ",screenY=" + upper + ",outerHeight=200,outerWidth=200");
|
||||
SimpleTest.waitForFocus(checkTest, win);
|
||||
}
|
||||
function checkTest() {
|
||||
is(win.screenX, 60, "The window should be placed now at x=60px");
|
||||
is(win.screenY, 60, "The window should be placed now at y=60px");
|
||||
is(win.screenX, left, "The window should be placed now at x=" + left + "px");
|
||||
is(win.screenY, upper, "The window should be placed now at y=" + upper + "px");
|
||||
is(win.outerHeight, 200, "The window size should be height=200px");
|
||||
is(win.outerWidth, 200, "The window size should be width=200px");
|
||||
runTest2();
|
||||
|
|
Загрузка…
Ссылка в новой задаче