merge mozilla-inbound to mozilla-central

This commit is contained in:
Carsten "Tomcat" Book 2014-05-06 14:22:56 +02:00
Родитель 3ac253f345 3ab8eb01df
Коммит 751727a836
62 изменённых файлов: 347 добавлений и 457 удалений

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

@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please # changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more. # don't change CLOBBER for WebIDL changes any more.
Bug 1003702 - Relanding ICU changes with a clobber Bug 1005321 - Requires a clobber because of bug 1005486

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

@ -1305,10 +1305,10 @@ DIST_FILES_FLAGS := $(XULAPP_DEFINES)
PP_TARGETS += DIST_FILES PP_TARGETS += DIST_FILES
endif endif
ifneq ($(DIST_CHROME_FILES),) ifneq ($(DIST_FILES_NO_PP),)
DIST_CHROME_FILES_PATH := $(FINAL_TARGET)/chrome _DIST_FILES := $(DIST_FILES_NO_PP)
DIST_CHROME_FILES_FLAGS := $(XULAPP_DEFINES) _DIST_DEST := $(FINAL_TARGET)
PP_TARGETS += DIST_CHROME_FILES INSTALL_TARGETS += _DIST
endif endif
ifneq ($(XPI_PKGNAME),) ifneq ($(XPI_PKGNAME),)

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

@ -18,7 +18,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=722599
<input type="text" id="input_text" onchange="++textInputChange[0];"></input> <input type="text" id="input_text" onchange="++textInputChange[0];"></input>
<input type="email" id="input_email" onchange="++textInputChange[1];"></input> <input type="email" id="input_email" onchange="++textInputChange[1];"></input>
<input type="search" id="input_search" onchange="++textInputChange[2];"></input> <input type="search" id="input_search" onchange="++textInputChange[2];"></input>
<input type="tel" id="input_telephone" onchange="++textInputChange[3];"></input> <input type="tel" id="input_tel" onchange="++textInputChange[3];"></input>
<input type="url" id="input_url" onchange="++textInputChange[4];"></input> <input type="url" id="input_url" onchange="++textInputChange[4];"></input>
<input type="password" id="input_password" onchange="++textInputChange[5];"></input> <input type="password" id="input_password" onchange="++textInputChange[5];"></input>
@ -43,7 +43,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=722599
var textareaChange = 0; var textareaChange = 0;
var fileInputChange = 0; var fileInputChange = 0;
var textInputTypes = ["text", "email", "search", "telephone", "url", "password"]; var textInputTypes = ["text", "email", "search", "tel", "url", "password"];
var textInputChange = [0, 0, 0, 0, 0, 0]; var textInputChange = [0, 0, 0, 0, 0, 0];
var NonTextInputTypes = ["button", "submit", "image", "reset", "radio", "checkbox"]; var NonTextInputTypes = ["button", "submit", "image", "reset", "radio", "checkbox"];

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

@ -18,7 +18,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=851780
<input type="text" id="input_text" oninput="++textInput[0];"></input> <input type="text" id="input_text" oninput="++textInput[0];"></input>
<input type="email" id="input_email" oninput="++textInput[1];"></input> <input type="email" id="input_email" oninput="++textInput[1];"></input>
<input type="search" id="input_search" oninput="++textInput[2];"></input> <input type="search" id="input_search" oninput="++textInput[2];"></input>
<input type="tel" id="input_telephone" oninput="++textInput[3];"></input> <input type="tel" id="input_tel" oninput="++textInput[3];"></input>
<input type="url" id="input_url" oninput="++textInput[4];"></input> <input type="url" id="input_url" oninput="++textInput[4];"></input>
<input type="password" id="input_password" oninput="++textInput[5];"></input> <input type="password" id="input_password" oninput="++textInput[5];"></input>
@ -43,7 +43,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=851780
var textareaInput = 0; var textareaInput = 0;
// Those are types were the input event apply. // Those are types were the input event apply.
var textTypes = ["text", "email", "search", "telephone", "url", "password"]; var textTypes = ["text", "email", "search", "tel", "url", "password"];
var textInput = [0, 0, 0, 0, 0, 0]; var textInput = [0, 0, 0, 0, 0, 0];
// Those are events were the input event does not apply. // Those are events were the input event does not apply.

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

@ -29,7 +29,7 @@ var validTypes =
["text", false], ["text", false],
["password", false], ["password", false],
["search", false], ["search", false],
["telephone", false], ["tel", false],
["email", false], ["email", false],
["url", false], ["url", false],
["hidden", false], ["hidden", false],

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

@ -28,7 +28,7 @@ function checkAvailability()
["text", false], ["text", false],
["password", false], ["password", false],
["search", false], ["search", false],
["telephone", false], ["tel", false],
["email", false], ["email", false],
["url", false], ["url", false],
["hidden", false], ["hidden", false],

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

@ -207,6 +207,8 @@ MediaDecoderStateMachine::MediaDecoderStateMachine(MediaDecoder* aDecoder,
mMinimizePreroll(false), mMinimizePreroll(false),
mDecodeThreadWaiting(false), mDecodeThreadWaiting(false),
mRealTime(aRealTime), mRealTime(aRealTime),
mDispatchedDecodeMetadataTask(false),
mDispatchedDecodeSeekTask(false),
mLastFrameStatus(MediaDecoderOwner::NEXT_FRAME_UNINITIALIZED), mLastFrameStatus(MediaDecoderOwner::NEXT_FRAME_UNINITIALIZED),
mTimerId(0) mTimerId(0)
{ {
@ -1486,12 +1488,18 @@ MediaDecoderStateMachine::EnqueueDecodeMetadataTask()
{ {
AssertCurrentThreadInMonitor(); AssertCurrentThreadInMonitor();
if (mState != DECODER_STATE_DECODING_METADATA) { if (mState != DECODER_STATE_DECODING_METADATA ||
mDispatchedDecodeMetadataTask) {
return NS_OK; return NS_OK;
} }
nsresult rv = mDecodeTaskQueue->Dispatch( nsresult rv = mDecodeTaskQueue->Dispatch(
NS_NewRunnableMethod(this, &MediaDecoderStateMachine::CallDecodeMetadata)); NS_NewRunnableMethod(this, &MediaDecoderStateMachine::CallDecodeMetadata));
NS_ENSURE_SUCCESS(rv, rv); if (NS_SUCCEEDED(rv)) {
mDispatchedDecodeMetadataTask = true;
} else {
NS_WARNING("Dispatch ReadMetadata task failed.");
return rv;
}
return NS_OK; return NS_OK;
} }
@ -1595,14 +1603,18 @@ MediaDecoderStateMachine::EnqueueDecodeSeekTask()
"Should be on state machine or decode thread."); "Should be on state machine or decode thread.");
AssertCurrentThreadInMonitor(); AssertCurrentThreadInMonitor();
if (mState != DECODER_STATE_SEEKING) { if (mState != DECODER_STATE_SEEKING ||
mDispatchedDecodeSeekTask) {
return NS_OK; return NS_OK;
} }
nsresult rv = mDecodeTaskQueue->Dispatch( nsresult rv = mDecodeTaskQueue->Dispatch(
NS_NewRunnableMethod(this, &MediaDecoderStateMachine::DecodeSeek)); NS_NewRunnableMethod(this, &MediaDecoderStateMachine::DecodeSeek));
NS_ENSURE_SUCCESS(rv, rv); if (NS_SUCCEEDED(rv)) {
mDispatchedDecodeSeekTask = true;
return NS_OK; } else {
NS_WARNING("Dispatch DecodeSeek task failed.");
}
return rv;
} }
nsresult nsresult
@ -1803,6 +1815,7 @@ void
MediaDecoderStateMachine::CallDecodeMetadata() MediaDecoderStateMachine::CallDecodeMetadata()
{ {
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor()); ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
AutoSetOnScopeExit<bool> unsetOnExit(mDispatchedDecodeMetadataTask, false);
if (mState != DECODER_STATE_DECODING_METADATA) { if (mState != DECODER_STATE_DECODING_METADATA) {
return; return;
} }
@ -1918,6 +1931,7 @@ void MediaDecoderStateMachine::DecodeSeek()
{ {
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor()); ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
NS_ASSERTION(OnDecodeThread(), "Should be on decode thread."); NS_ASSERTION(OnDecodeThread(), "Should be on decode thread.");
AutoSetOnScopeExit<bool> unsetOnExit(mDispatchedDecodeSeekTask, false);
if (mState != DECODER_STATE_SEEKING) { if (mState != DECODER_STATE_SEEKING) {
return; return;
} }

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

@ -932,6 +932,16 @@ protected:
// True is we are decoding a realtime stream, like a camera stream // True is we are decoding a realtime stream, like a camera stream
bool mRealTime; bool mRealTime;
// True if we've dispatched a task to the decode task queue to call
// ReadMetadata on the reader. We maintain a flag to ensure that we don't
// dispatch multiple tasks to re-do the metadata loading.
bool mDispatchedDecodeMetadataTask;
// True if we've dispatched a task to the decode task queue to call
// Seek on the reader. We maintain a flag to ensure that we don't
// dispatch multiple tasks to re-do the seek.
bool mDispatchedDecodeSeekTask;
// Stores presentation info required for playback. The decoder monitor // Stores presentation info required for playback. The decoder monitor
// must be held when accessing this. // must be held when accessing this.
MediaInfo mInfo; MediaInfo mInfo;

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

@ -169,6 +169,23 @@ bool IsVideoContentType(const nsCString& aContentType);
bool IsValidVideoRegion(const nsIntSize& aFrame, const nsIntRect& aPicture, bool IsValidVideoRegion(const nsIntSize& aFrame, const nsIntRect& aPicture,
const nsIntSize& aDisplay); const nsIntSize& aDisplay);
// Template to automatically set a variable to a value on scope exit.
// Useful for unsetting flags, etc.
template<typename T>
class AutoSetOnScopeExit {
public:
AutoSetOnScopeExit(T& aVar, T aValue)
: mVar(aVar)
, mValue(aValue)
{}
~AutoSetOnScopeExit() {
mVar = mValue;
}
private:
T& mVar;
const T mValue;
};
} // end namespace mozilla } // end namespace mozilla
#endif #endif

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

@ -298,41 +298,6 @@ BiquadFilterNode::WrapObject(JSContext* aCx)
void void
BiquadFilterNode::SetType(BiquadFilterType aType) BiquadFilterNode::SetType(BiquadFilterType aType)
{ {
if (!Preferences::GetBool("media.webaudio.legacy.BiquadFilterNode")) {
// Do not accept the alternate enum values unless the legacy pref
// has been turned on.
switch (aType) {
case BiquadFilterType::_0:
case BiquadFilterType::_1:
case BiquadFilterType::_2:
case BiquadFilterType::_3:
case BiquadFilterType::_4:
case BiquadFilterType::_5:
case BiquadFilterType::_6:
case BiquadFilterType::_7:
// Do nothing in order to emulate setting an invalid enum value.
return;
default:
// Shut up the compiler warning
break;
}
}
// Handle the alternate enum values
switch (aType) {
case BiquadFilterType::_0: aType = BiquadFilterType::Lowpass; break;
case BiquadFilterType::_1: aType = BiquadFilterType::Highpass; break;
case BiquadFilterType::_2: aType = BiquadFilterType::Bandpass; break;
case BiquadFilterType::_3: aType = BiquadFilterType::Lowshelf; break;
case BiquadFilterType::_4: aType = BiquadFilterType::Highshelf; break;
case BiquadFilterType::_5: aType = BiquadFilterType::Peaking; break;
case BiquadFilterType::_6: aType = BiquadFilterType::Notch; break;
case BiquadFilterType::_7: aType = BiquadFilterType::Allpass; break;
default:
// Shut up the compiler warning
break;
}
mType = aType; mType = aType;
SendInt32ParameterToStream(BiquadFilterNodeEngine::TYPE, SendInt32ParameterToStream(BiquadFilterNodeEngine::TYPE,
static_cast<int32_t>(aType)); static_cast<int32_t>(aType));

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

@ -48,34 +48,6 @@ public:
} }
void SetType(OscillatorType aType, ErrorResult& aRv) void SetType(OscillatorType aType, ErrorResult& aRv)
{ {
if (!Preferences::GetBool("media.webaudio.legacy.OscillatorNode")) {
// Do not accept the alternate enum values unless the legacy pref
// has been turned on.
switch (aType) {
case OscillatorType::_0:
case OscillatorType::_1:
case OscillatorType::_2:
case OscillatorType::_3:
case OscillatorType::_4:
// Do nothing in order to emulate setting an invalid enum value.
return;
default:
// Shut up the compiler warning
break;
}
}
// Handle the alternate enum values
switch (aType) {
case OscillatorType::_0: aType = OscillatorType::Sine; break;
case OscillatorType::_1: aType = OscillatorType::Square; break;
case OscillatorType::_2: aType = OscillatorType::Sawtooth; break;
case OscillatorType::_3: aType = OscillatorType::Triangle; break;
case OscillatorType::_4: aType = OscillatorType::Custom; break;
default:
// Shut up the compiler warning
break;
}
if (aType == OscillatorType::Custom) { if (aType == OscillatorType::Custom) {
// ::Custom can only be set by setPeriodicWave(). // ::Custom can only be set by setPeriodicWave().
// https://github.com/WebAudio/web-audio-api/issues/105 for exception. // https://github.com/WebAudio/web-audio-api/issues/105 for exception.
@ -96,15 +68,7 @@ public:
} }
void Start(double aWhen, ErrorResult& aRv); void Start(double aWhen, ErrorResult& aRv);
void NoteOn(double aWhen, ErrorResult& aRv)
{
Start(aWhen, aRv);
}
void Stop(double aWhen, ErrorResult& aRv); void Stop(double aWhen, ErrorResult& aRv);
void NoteOff(double aWhen, ErrorResult& aRv)
{
Stop(aWhen, aRv);
}
void SetPeriodicWave(PeriodicWave& aPeriodicWave) void SetPeriodicWave(PeriodicWave& aPeriodicWave)
{ {
mPeriodicWave = &aPeriodicWave; mPeriodicWave = &aPeriodicWave;

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

@ -60,29 +60,6 @@ public:
} }
void SetPanningModel(PanningModelType aPanningModel) void SetPanningModel(PanningModelType aPanningModel)
{ {
if (!Preferences::GetBool("media.webaudio.legacy.PannerNode")) {
// Do not accept the alternate enum values unless the legacy pref
// has been turned on.
switch (aPanningModel) {
case PanningModelType::_0:
case PanningModelType::_1:
// Do nothing in order to emulate setting an invalid enum value.
return;
default:
// Shut up the compiler warning
break;
}
}
// Handle the alternate enum values
switch (aPanningModel) {
case PanningModelType::_0: aPanningModel = PanningModelType::Equalpower; break;
case PanningModelType::_1: aPanningModel = PanningModelType::HRTF; break;
default:
// Shut up the compiler warning
break;
}
mPanningModel = aPanningModel; mPanningModel = aPanningModel;
SendInt32ParameterToStream(PANNING_MODEL, int32_t(mPanningModel)); SendInt32ParameterToStream(PANNING_MODEL, int32_t(mPanningModel));
} }
@ -93,31 +70,6 @@ public:
} }
void SetDistanceModel(DistanceModelType aDistanceModel) void SetDistanceModel(DistanceModelType aDistanceModel)
{ {
if (!Preferences::GetBool("media.webaudio.legacy.PannerNode")) {
// Do not accept the alternate enum values unless the legacy pref
// has been turned on.
switch (aDistanceModel) {
case DistanceModelType::_0:
case DistanceModelType::_1:
case DistanceModelType::_2:
// Do nothing in order to emulate setting an invalid enum value.
return;
default:
// Shut up the compiler warning
break;
}
}
// Handle the alternate enum values
switch (aDistanceModel) {
case DistanceModelType::_0: aDistanceModel = DistanceModelType::Linear; break;
case DistanceModelType::_1: aDistanceModel = DistanceModelType::Inverse; break;
case DistanceModelType::_2: aDistanceModel = DistanceModelType::Exponential; break;
default:
// Shut up the compiler warning
break;
}
mDistanceModel = aDistanceModel; mDistanceModel = aDistanceModel;
SendInt32ParameterToStream(DISTANCE_MODEL, int32_t(mDistanceModel)); SendInt32ParameterToStream(DISTANCE_MODEL, int32_t(mDistanceModel));
} }

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

@ -55,8 +55,6 @@ addLoadEvent(function() {
"allpass", "allpass",
]; ];
for (var i = 0; i < types.length; ++i) { for (var i = 0; i < types.length; ++i) {
filter.type = filter[types[i].toUpperCase()];
is(filter.type, types[i], "Correct alternname type enum value");
filter.type = types[i]; filter.type = types[i];
} }

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

@ -23,9 +23,6 @@ addLoadEvent(function() {
expectException(function() { expectException(function() {
osc.type = "custom"; osc.type = "custom";
}, DOMException.INVALID_STATE_ERR); }, DOMException.INVALID_STATE_ERR);
expectException(function() {
osc.type = osc.CUSTOM;
}, DOMException.INVALID_STATE_ERR);
is(osc.type, "sine", "Cannot set the type to custom"); is(osc.type, "sine", "Cannot set the type to custom");
is(osc.frequency.value, 440, "Correct default frequency value"); is(osc.frequency.value, 440, "Correct default frequency value");
is(osc.detune.value, 0, "Correct default detine value"); is(osc.detune.value, 0, "Correct default detine value");
@ -38,8 +35,6 @@ addLoadEvent(function() {
"triangle", "triangle",
]; ];
for (var i = 0; i < types.length; ++i) { for (var i = 0; i < types.length; ++i) {
osc.type = osc[types[i].toUpperCase()];
is(osc.type, types[i], "Correct alternname type enum value");
osc.type = types[i]; osc.type = types[i];
} }

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

@ -45,17 +45,6 @@ addLoadEvent(function() {
is(panner.channelCountMode, "clamped-max", "Correct channelCountMode for the panner node"); is(panner.channelCountMode, "clamped-max", "Correct channelCountMode for the panner node");
is(panner.channelInterpretation, "speakers", "Correct channelCountInterpretation for the panner node"); is(panner.channelInterpretation, "speakers", "Correct channelCountInterpretation for the panner node");
panner.panningModel = panner.EQUALPOWER;
is(panner.panningModel, "equalpower", "Correct alternate panningModel enum value");
panner.panningModel = panner.HRTF;
is(panner.panningModel, "HRTF", "Correct alternate panningModel enum value");
panner.distanceModel = panner.LINEAR_DISTANCE;
is(panner.distanceModel, "linear", "Correct alternate distanceModel enum value");
panner.distanceModel = panner.INVERSE_DISTANCE;
is(panner.distanceModel, "inverse", "Correct alternate distanceModel enum value");
panner.distanceModel = panner.EXPONENTIAL_DISTANCE;
is(panner.distanceModel, "exponential", "Correct alternate distanceModel enum value");
panner.setPosition(1, 1, 1); panner.setPosition(1, 1, 1);
panner.setOrientation(1, 1, 1); panner.setOrientation(1, 1, 1);
panner.setVelocity(1, 1, 1); panner.setVelocity(1, 1, 1);

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

@ -5580,6 +5580,8 @@ class CGCallGenerator(CGThing):
self.cgRoot.append(CGIndenter(errorReport)) self.cgRoot.append(CGIndenter(errorReport))
self.cgRoot.append(CGGeneric("}\n")) self.cgRoot.append(CGGeneric("}\n"))
self.cgRoot.append(CGGeneric("MOZ_ASSERT(!JS_IsExceptionPending(cx));\n"))
def define(self): def define(self):
return self.cgRoot.define() return self.cgRoot.define()

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

@ -3,10 +3,13 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
DIST_FILES = \ DIST_FILES = \
bootstrap.js \
install.rdf \ install.rdf \
$(NULL) $(NULL)
DIST_FILES_NO_PP = \
bootstrap.js \
$(NULL)
TEST_EXTENSIONS_DIR = $(DEPTH)/_tests/testing/mochitest/extensions TEST_EXTENSIONS_DIR = $(DEPTH)/_tests/testing/mochitest/extensions
GENERATED_DIRS = $(TEST_EXTENSIONS_DIR) GENERATED_DIRS = $(TEST_EXTENSIONS_DIR)

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

@ -11,9 +11,6 @@
*/ */
enum BiquadFilterType { enum BiquadFilterType {
// Hack: Use numbers to support alternate enum values
"0", "1", "2", "3", "4", "5", "6", "7",
"lowpass", "lowpass",
"highpass", "highpass",
"bandpass", "bandpass",
@ -38,26 +35,3 @@ interface BiquadFilterNode : AudioNode {
}; };
/*
* The origin of this IDL file is
* https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AlternateNames
*/
partial interface BiquadFilterNode {
[Pref="media.webaudio.legacy.BiquadFilterNode"]
const unsigned short LOWPASS = 0;
[Pref="media.webaudio.legacy.BiquadFilterNode"]
const unsigned short HIGHPASS = 1;
[Pref="media.webaudio.legacy.BiquadFilterNode"]
const unsigned short BANDPASS = 2;
[Pref="media.webaudio.legacy.BiquadFilterNode"]
const unsigned short LOWSHELF = 3;
[Pref="media.webaudio.legacy.BiquadFilterNode"]
const unsigned short HIGHSHELF = 4;
[Pref="media.webaudio.legacy.BiquadFilterNode"]
const unsigned short PEAKING = 5;
[Pref="media.webaudio.legacy.BiquadFilterNode"]
const unsigned short NOTCH = 6;
[Pref="media.webaudio.legacy.BiquadFilterNode"]
const unsigned short ALLPASS = 7;
};

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

@ -11,9 +11,6 @@
*/ */
enum OscillatorType { enum OscillatorType {
// Hack: Use numbers to support alternate enum values
"0", "1", "2", "3", "4",
"sine", "sine",
"square", "square",
"sawtooth", "sawtooth",
@ -39,28 +36,3 @@ interface OscillatorNode : AudioNode {
}; };
/*
* The origin of this IDL file is
* https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AlternateNames
*/
partial interface OscillatorNode {
// Same as start()
[Throws,Pref="media.webaudio.legacy.OscillatorNode"]
void noteOn(double when);
// Same as stop()
[Throws,Pref="media.webaudio.legacy.OscillatorNode"]
void noteOff(double when);
[Pref="media.webaudio.legacy.OscillatorNode"]
const unsigned short SINE = 0;
[Pref="media.webaudio.legacy.OscillatorNode"]
const unsigned short SQUARE = 1;
[Pref="media.webaudio.legacy.OscillatorNode"]
const unsigned short SAWTOOTH = 2;
[Pref="media.webaudio.legacy.OscillatorNode"]
const unsigned short TRIANGLE = 3;
[Pref="media.webaudio.legacy.OscillatorNode"]
const unsigned short CUSTOM = 4;
};

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

@ -11,17 +11,11 @@
*/ */
enum PanningModelType { enum PanningModelType {
// Hack: Use numbers to support alternate enum values
"0", "1",
"equalpower", "equalpower",
"HRTF" "HRTF"
}; };
enum DistanceModelType { enum DistanceModelType {
// Hack: Use numbers to support alternate enum values
"0", "1", "2",
"linear", "linear",
"inverse", "inverse",
"exponential" "exponential"
@ -50,21 +44,3 @@ interface PannerNode : AudioNode {
}; };
/*
* The origin of this IDL file is
* https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AlternateNames
*/
partial interface PannerNode {
[Pref="media.webaudio.legacy.PannerNode"]
const unsigned short EQUALPOWER = 0;
[Pref="media.webaudio.legacy.PannerNode"]
const unsigned short HRTF = 1;
[Pref="media.webaudio.legacy.PannerNode"]
const unsigned short LINEAR_DISTANCE = 0;
[Pref="media.webaudio.legacy.PannerNode"]
const unsigned short INVERSE_DISTANCE = 1;
[Pref="media.webaudio.legacy.PannerNode"]
const unsigned short EXPONENTIAL_DISTANCE = 2;
};

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

@ -3,8 +3,11 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
DIST_FILES = \ DIST_FILES = \
bootstrap.js \
install.rdf \ install.rdf \
$(NULL)
DIST_FILES_NO_PP = \
bootstrap.js \
worker.js \ worker.js \
$(NULL) $(NULL)

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

@ -4,6 +4,9 @@
DIST_FILES = \ DIST_FILES = \
install.rdf \ install.rdf \
$(NULL)
DIST_FILES_NO_PP = \
worker.js \ worker.js \
$(NULL) $(NULL)

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

@ -9,6 +9,7 @@
// access the dictionary resources. // access the dictionary resources.
#include "hnjalloc.h" #include "hnjalloc.h"
#undef FILE // Undo the damage done in hnjalloc.h
#include "nsNetUtil.h" #include "nsNetUtil.h"
#define BUFSIZE 1024 #define BUFSIZE 1024

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

@ -5,12 +5,13 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
UNIFIED_SOURCES += [ UNIFIED_SOURCES += [
'hnjstdio.cpp',
'nsHyphenationManager.cpp', 'nsHyphenationManager.cpp',
'nsHyphenator.cpp', 'nsHyphenator.cpp',
] ]
# These files cannot be built in unified mode because they include hnjalloc.h.
SOURCES += [ SOURCES += [
'hnjstdio.cpp',
'hyphen.c', 'hyphen.c',
] ]

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

@ -41,10 +41,10 @@ const size_t CellSize = size_t(1) << CellShift;
const size_t CellMask = CellSize - 1; const size_t CellMask = CellSize - 1;
/* These are magic constants derived from actual offsets in gc/Heap.h. */ /* These are magic constants derived from actual offsets in gc/Heap.h. */
const size_t ChunkMarkBitmapOffset = 1032360; const size_t ChunkMarkBitmapOffset = 1032352;
const size_t ChunkMarkBitmapBits = 129024; const size_t ChunkMarkBitmapBits = 129024;
const size_t ChunkRuntimeOffset = ChunkSize - sizeof(void*); const size_t ChunkRuntimeOffset = ChunkSize - sizeof(void*);
const size_t ChunkLocationOffset = ChunkSize - sizeof(void*) - sizeof(uintptr_t); const size_t ChunkLocationOffset = ChunkSize - 2 * sizeof(void*) - sizeof(uint64_t);
/* /*
* Live objects are marked black. How many other additional colors are available * Live objects are marked black. How many other additional colors are available

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

@ -15,6 +15,7 @@
#include "jspubtd.h" #include "jspubtd.h"
#include "js/HeapAPI.h"
#include "js/TypeDecls.h" #include "js/TypeDecls.h"
#include "js/Utility.h" #include "js/Utility.h"
@ -665,7 +666,9 @@ struct GCMethods<JSObject *>
static JSObject *initial() { return nullptr; } static JSObject *initial() { return nullptr; }
static ThingRootKind kind() { return RootKind<JSObject *>::rootKind(); } static ThingRootKind kind() { return RootKind<JSObject *>::rootKind(); }
static bool poisoned(JSObject *v) { return JS::IsPoisonedPtr(v); } static bool poisoned(JSObject *v) { return JS::IsPoisonedPtr(v); }
static bool needsPostBarrier(JSObject *v) { return v; } static bool needsPostBarrier(JSObject *v) {
return v != nullptr && gc::IsInsideNursery(reinterpret_cast<gc::Cell *>(v));
}
#ifdef JSGC_GENERATIONAL #ifdef JSGC_GENERATIONAL
static void postBarrier(JSObject **vp) { static void postBarrier(JSObject **vp) {
JS::HeapCellPostBarrier(reinterpret_cast<js::gc::Cell **>(vp)); JS::HeapCellPostBarrier(reinterpret_cast<js::gc::Cell **>(vp));

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

@ -1556,7 +1556,9 @@ template <> struct GCMethods<JS::Value>
static JS::Value initial() { return JS::UndefinedValue(); } static JS::Value initial() { return JS::UndefinedValue(); }
static ThingRootKind kind() { return THING_ROOT_VALUE; } static ThingRootKind kind() { return THING_ROOT_VALUE; }
static bool poisoned(const JS::Value &v) { return JS::IsPoisonedValue(v); } static bool poisoned(const JS::Value &v) { return JS::IsPoisonedValue(v); }
static bool needsPostBarrier(const JS::Value &v) { return v.isMarkable(); } static bool needsPostBarrier(const JS::Value &v) {
return v.isObject() && gc::IsInsideNursery(reinterpret_cast<gc::Cell*>(&v.toObject()));
}
#ifdef JSGC_GENERATIONAL #ifdef JSGC_GENERATIONAL
static void postBarrier(JS::Value *v) { JS::HeapValuePostBarrier(v); } static void postBarrier(JS::Value *v) { JS::HeapValuePostBarrier(v); }
static void relocate(JS::Value *v) { JS::HeapValueRelocate(v); } static void relocate(JS::Value *v) { JS::HeapValueRelocate(v); }

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

@ -42,12 +42,12 @@ HeapSlot::preconditionForSet(Zone *zone, JSObject *owner, Kind kind, uint32_t sl
return ok && owner->zone() == zone; return ok && owner->zone() == zone;
} }
void bool
HeapSlot::preconditionForWriteBarrierPost(JSObject *obj, Kind kind, uint32_t slot, Value target) HeapSlot::preconditionForWriteBarrierPost(JSObject *obj, Kind kind, uint32_t slot, Value target) const
{ {
JS_ASSERT_IF(kind == Slot, obj->getSlotAddressUnchecked(slot)->get() == target); return kind == Slot
JS_ASSERT_IF(kind == Element, ? obj->getSlotAddressUnchecked(slot)->get() == target
static_cast<HeapSlot *>(obj->getDenseElements() + slot)->get() == target); : static_cast<HeapSlot *>(obj->getDenseElements() + slot)->get() == target;
} }
bool bool

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

@ -233,9 +233,9 @@ class BarrieredCell : public gc::Cell
#endif #endif
} }
static void writeBarrierPost(T *thing, void *addr) {} static void writeBarrierPost(T *thing, void *cellp) {}
static void writeBarrierPostRelocate(T *thing, void *addr) {} static void writeBarrierPostRelocate(T *thing, void *cellp) {}
static void writeBarrierPostRemove(T *thing, void *addr) {} static void writeBarrierPostRemove(T *thing, void *cellp) {}
}; };
} // namespace gc } // namespace gc
@ -243,30 +243,12 @@ class BarrieredCell : public gc::Cell
// Note: the following Zone-getting functions must be equivalent to the zone() // Note: the following Zone-getting functions must be equivalent to the zone()
// and shadowZone() functions implemented by the subclasses of BarrieredCell. // and shadowZone() functions implemented by the subclasses of BarrieredCell.
JS::Zone *
ZoneOfObject(const JSObject &obj);
static inline JS::shadow::Zone *
ShadowZoneOfObject(JSObject *obj)
{
return JS::shadow::Zone::asShadowZone(ZoneOfObject(*obj));
}
static inline JS::shadow::Zone * static inline JS::shadow::Zone *
ShadowZoneOfString(JSString *str) ShadowZoneOfString(JSString *str)
{ {
return JS::shadow::Zone::asShadowZone(reinterpret_cast<const js::gc::Cell *>(str)->tenuredZone()); return JS::shadow::Zone::asShadowZone(reinterpret_cast<const js::gc::Cell *>(str)->tenuredZone());
} }
MOZ_ALWAYS_INLINE JS::Zone *
ZoneOfValue(const JS::Value &value)
{
JS_ASSERT(value.isMarkable());
if (value.isObject())
return ZoneOfObject(value.toObject());
return static_cast<js::gc::Cell *>(value.toGCThing())->tenuredZone();
}
JS::Zone * JS::Zone *
ZoneOfObjectFromAnyThread(const JSObject &obj); ZoneOfObjectFromAnyThread(const JSObject &obj);
@ -339,6 +321,7 @@ struct InternalGCMethods<Value>
preBarrier(ZoneOfValueFromAnyThread(v), v); preBarrier(ZoneOfValueFromAnyThread(v), v);
#endif #endif
} }
static void preBarrier(Zone *zone, Value v) { static void preBarrier(Zone *zone, Value v) {
#ifdef JSGC_INCREMENTAL #ifdef JSGC_INCREMENTAL
if (v.isString() && StringIsPermanentAtom(v.toString())) if (v.isString() && StringIsPermanentAtom(v.toString()))
@ -352,24 +335,34 @@ struct InternalGCMethods<Value>
} }
#endif #endif
} }
static void postBarrier(Value *vp) { static void postBarrier(Value *vp) {
#ifdef JSGC_GENERATIONAL #ifdef JSGC_GENERATIONAL
if (vp->isObject()) if (vp->isObject()) {
shadowRuntimeFromAnyThread(*vp)->gcStoreBufferPtr()->putValue(vp); gc::StoreBuffer *sb = reinterpret_cast<gc::Cell *>(&vp->toObject())->storeBuffer();
if (sb)
sb->putValueFromAnyThread(vp);
}
#endif #endif
} }
static void postBarrierRelocate(Value *vp) { static void postBarrierRelocate(Value *vp) {
#ifdef JSGC_GENERATIONAL #ifdef JSGC_GENERATIONAL
shadowRuntimeFromAnyThread(*vp)->gcStoreBufferPtr()->putRelocatableValue(vp); if (vp->isObject()) {
gc::StoreBuffer *sb = reinterpret_cast<gc::Cell *>(&vp->toObject())->storeBuffer();
if (sb)
sb->putRelocatableValueFromAnyThread(vp);
}
#endif #endif
} }
static void postBarrierRemove(Value *vp) { static void postBarrierRemove(Value *vp) {
#ifdef JSGC_GENERATIONAL #ifdef JSGC_GENERATIONAL
JS_ASSERT(vp);
JS_ASSERT(vp->isMarkable());
JSRuntime *rt = static_cast<js::gc::Cell *>(vp->toGCThing())->runtimeFromAnyThread(); JSRuntime *rt = static_cast<js::gc::Cell *>(vp->toGCThing())->runtimeFromAnyThread();
JS::shadow::Runtime *shadowRuntime = JS::shadow::Runtime::asShadowRuntime(rt); JS::shadow::Runtime *shadowRuntime = JS::shadow::Runtime::asShadowRuntime(rt);
shadowRuntime->gcStoreBufferPtr()->removeRelocatableValue(vp); shadowRuntime->gcStoreBufferPtr()->removeRelocatableValueFromAnyThread(vp);
#endif #endif
} }
@ -608,7 +601,7 @@ class RelocatablePtr : public BarrieredBase<T>
public: public:
RelocatablePtr() : BarrieredBase<T>(GCMethods<T>::initial()) {} RelocatablePtr() : BarrieredBase<T>(GCMethods<T>::initial()) {}
explicit RelocatablePtr(T v) : BarrieredBase<T>(v) { explicit RelocatablePtr(T v) : BarrieredBase<T>(v) {
if (isMarkable(v)) if (GCMethods<T>::needsPostBarrier(v))
post(); post();
} }
@ -619,22 +612,22 @@ class RelocatablePtr : public BarrieredBase<T>
* simply omit the rvalue variant. * simply omit the rvalue variant.
*/ */
RelocatablePtr(const RelocatablePtr<T> &v) : BarrieredBase<T>(v) { RelocatablePtr(const RelocatablePtr<T> &v) : BarrieredBase<T>(v) {
if (isMarkable(this->value)) if (GCMethods<T>::needsPostBarrier(this->value))
post(); post();
} }
~RelocatablePtr() { ~RelocatablePtr() {
if (isMarkable(this->value)) if (GCMethods<T>::needsPostBarrier(this->value))
relocate(); relocate();
} }
RelocatablePtr<T> &operator=(T v) { RelocatablePtr<T> &operator=(T v) {
this->pre(); this->pre();
JS_ASSERT(!GCMethods<T>::poisoned(v)); JS_ASSERT(!GCMethods<T>::poisoned(v));
if (isMarkable(v)) { if (GCMethods<T>::needsPostBarrier(v)) {
this->value = v; this->value = v;
post(); post();
} else if (isMarkable(this->value)) { } else if (GCMethods<T>::needsPostBarrier(this->value)) {
relocate(); relocate();
this->value = v; this->value = v;
} else { } else {
@ -646,10 +639,10 @@ class RelocatablePtr : public BarrieredBase<T>
RelocatablePtr<T> &operator=(const RelocatablePtr<T> &v) { RelocatablePtr<T> &operator=(const RelocatablePtr<T> &v) {
this->pre(); this->pre();
JS_ASSERT(!GCMethods<T>::poisoned(v.value)); JS_ASSERT(!GCMethods<T>::poisoned(v.value));
if (isMarkable(v.value)) { if (GCMethods<T>::needsPostBarrier(v.value)) {
this->value = v.value; this->value = v.value;
post(); post();
} else if (isMarkable(this->value)) { } else if (GCMethods<T>::needsPostBarrier(this->value)) {
relocate(); relocate();
this->value = v; this->value = v;
} else { } else {
@ -660,20 +653,16 @@ class RelocatablePtr : public BarrieredBase<T>
} }
protected: protected:
static bool isMarkable(const T &v) {
return InternalGCMethods<T>::isMarkable(v);
}
void post() { void post() {
#ifdef JSGC_GENERATIONAL #ifdef JSGC_GENERATIONAL
JS_ASSERT(isMarkable(this->value)); JS_ASSERT(GCMethods<T>::needsPostBarrier(this->value));
InternalGCMethods<T>::postBarrierRelocate(&this->value); InternalGCMethods<T>::postBarrierRelocate(&this->value);
#endif #endif
} }
void relocate() { void relocate() {
#ifdef JSGC_GENERATIONAL #ifdef JSGC_GENERATIONAL
JS_ASSERT(isMarkable(this->value)); JS_ASSERT(GCMethods<T>::needsPostBarrier(this->value));
InternalGCMethods<T>::postBarrierRemove(&this->value); InternalGCMethods<T>::postBarrierRemove(&this->value);
#endif #endif
} }
@ -864,64 +853,43 @@ class HeapSlot : public BarrieredBase<Value>
post(owner, kind, slot, v); post(owner, kind, slot, v);
} }
void init(JSRuntime *rt, JSObject *owner, Kind kind, uint32_t slot, const Value &v) {
value = v;
post(rt, owner, kind, slot, v);
}
#ifdef DEBUG #ifdef DEBUG
bool preconditionForSet(JSObject *owner, Kind kind, uint32_t slot); bool preconditionForSet(JSObject *owner, Kind kind, uint32_t slot);
bool preconditionForSet(Zone *zone, JSObject *owner, Kind kind, uint32_t slot); bool preconditionForSet(Zone *zone, JSObject *owner, Kind kind, uint32_t slot);
static void preconditionForWriteBarrierPost(JSObject *obj, Kind kind, uint32_t slot, bool preconditionForWriteBarrierPost(JSObject *obj, Kind kind, uint32_t slot, Value target) const;
Value target);
#endif #endif
void set(JSObject *owner, Kind kind, uint32_t slot, const Value &v) { void set(JSObject *owner, Kind kind, uint32_t slot, const Value &v) {
JS_ASSERT(preconditionForSet(owner, kind, slot)); JS_ASSERT(preconditionForSet(owner, kind, slot));
pre();
JS_ASSERT(!IsPoisonedValue(v)); JS_ASSERT(!IsPoisonedValue(v));
pre();
value = v; value = v;
post(owner, kind, slot, v); post(owner, kind, slot, v);
} }
void set(Zone *zone, JSObject *owner, Kind kind, uint32_t slot, const Value &v) { void set(Zone *zone, JSObject *owner, Kind kind, uint32_t slot, const Value &v) {
JS_ASSERT(preconditionForSet(zone, owner, kind, slot)); JS_ASSERT(preconditionForSet(zone, owner, kind, slot));
JS::shadow::Zone *shadowZone = JS::shadow::Zone::asShadowZone(zone);
pre(zone);
JS_ASSERT(!IsPoisonedValue(v)); JS_ASSERT(!IsPoisonedValue(v));
pre(zone);
value = v; value = v;
post(shadowZone->runtimeFromAnyThread(), owner, kind, slot, v); post(owner, kind, slot, v);
} }
static void writeBarrierPost(JSObject *obj, Kind kind, uint32_t slot, const Value &target) /* For users who need to manually barrier the raw types. */
{ static void writeBarrierPost(JSObject *owner, Kind kind, uint32_t slot, const Value &target) {
#ifdef JSGC_GENERATIONAL reinterpret_cast<HeapSlot *>(const_cast<Value *>(&target))->post(owner, kind, slot, target);
js::gc::Cell *cell = reinterpret_cast<js::gc::Cell*>(obj);
writeBarrierPost(cell->runtimeFromAnyThread(), obj, kind, slot, target);
#endif
}
static void writeBarrierPost(JSRuntime *rt, JSObject *obj, Kind kind, uint32_t slot,
const Value &target)
{
#ifdef DEBUG
preconditionForWriteBarrierPost(obj, kind, slot, target);
#endif
#ifdef JSGC_GENERATIONAL
if (target.isObject()) {
JS::shadow::Runtime *shadowRuntime = JS::shadow::Runtime::asShadowRuntime(rt);
shadowRuntime->gcStoreBufferPtr()->putSlot(obj, kind, slot, 1);
}
#endif
} }
private: private:
void post(JSObject *owner, Kind kind, uint32_t slot, Value target) { void post(JSObject *owner, Kind kind, uint32_t slot, const Value &target) {
HeapSlot::writeBarrierPost(owner, kind, slot, target); JS_ASSERT(preconditionForWriteBarrierPost(owner, kind, slot, target));
} #ifdef JSGC_GENERATIONAL
if (this->value.isObject()) {
void post(JSRuntime *rt, JSObject *owner, Kind kind, uint32_t slot, Value target) { gc::Cell *cell = reinterpret_cast<gc::Cell *>(&this->value.toObject());
HeapSlot::writeBarrierPost(rt, owner, kind, slot, target); if (cell->storeBuffer())
cell->storeBuffer()->putSlotFromAnyThread(owner, kind, slot, 1);
}
#endif
} }
}; };

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

@ -111,6 +111,8 @@ struct Cell
inline JSRuntime *runtimeFromAnyThread() const; inline JSRuntime *runtimeFromAnyThread() const;
inline JS::shadow::Runtime *shadowRuntimeFromAnyThread() const; inline JS::shadow::Runtime *shadowRuntimeFromAnyThread() const;
inline StoreBuffer *storeBuffer() const;
#ifdef DEBUG #ifdef DEBUG
inline bool isAligned() const; inline bool isAligned() const;
inline bool isTenured() const; inline bool isTenured() const;
@ -608,15 +610,16 @@ struct ChunkTrailer
{ {
/* The index the chunk in the nursery, or LocationTenuredHeap. */ /* The index the chunk in the nursery, or LocationTenuredHeap. */
uint32_t location; uint32_t location;
#if JS_BITS_PER_WORD == 64
uint32_t padding; uint32_t padding;
#endif
/* The store buffer for writes to things in this chunk or nullptr. */
StoreBuffer *storeBuffer;
JSRuntime *runtime; JSRuntime *runtime;
}; };
static_assert(sizeof(ChunkTrailer) == 2 * sizeof(uintptr_t), "ChunkTrailer size is incorrect."); static_assert(sizeof(ChunkTrailer) == 2 * sizeof(uintptr_t) + sizeof(uint64_t),
"ChunkTrailer size is incorrect.");
/* The chunk header (located at the end of the chunk to preserve arena alignment). */ /* The chunk header (located at the end of the chunk to preserve arena alignment). */
struct ChunkInfo struct ChunkInfo
@ -865,9 +868,13 @@ static_assert(sizeof(Chunk) == ChunkSize,
static_assert(js::gc::ChunkMarkBitmapOffset == offsetof(Chunk, bitmap), static_assert(js::gc::ChunkMarkBitmapOffset == offsetof(Chunk, bitmap),
"The hardcoded API bitmap offset must match the actual offset."); "The hardcoded API bitmap offset must match the actual offset.");
static_assert(js::gc::ChunkRuntimeOffset == offsetof(Chunk, info) + static_assert(js::gc::ChunkRuntimeOffset == offsetof(Chunk, info) +
offsetof(ChunkInfo, trailer) + offsetof(ChunkInfo, trailer) +
offsetof(ChunkTrailer, runtime), offsetof(ChunkTrailer, runtime),
"The hardcoded API runtime offset must match the actual offset."); "The hardcoded API runtime offset must match the actual offset.");
static_assert(js::gc::ChunkLocationOffset == offsetof(Chunk, info) +
offsetof(ChunkInfo, trailer) +
offsetof(ChunkTrailer, location),
"The hardcoded API location offset must match the actual offset.");
inline uintptr_t inline uintptr_t
ArenaHeader::address() const ArenaHeader::address() const
@ -1097,6 +1104,12 @@ Cell::chunk() const
return reinterpret_cast<Chunk *>(addr); return reinterpret_cast<Chunk *>(addr);
} }
inline StoreBuffer *
Cell::storeBuffer() const
{
return chunk()->info.trailer.storeBuffer;
}
inline bool inline bool
InFreeList(ArenaHeader *aheader, void *thing) InFreeList(ArenaHeader *aheader, void *thing)
{ {

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

@ -203,6 +203,7 @@ class Nursery
MOZ_ALWAYS_INLINE void initChunk(int chunkno) { MOZ_ALWAYS_INLINE void initChunk(int chunkno) {
NurseryChunkLayout &c = chunk(chunkno); NurseryChunkLayout &c = chunk(chunkno);
c.trailer.storeBuffer = JS::shadow::Runtime::asShadowRuntime(runtime())->gcStoreBufferPtr();
c.trailer.location = gc::ChunkLocationNursery; c.trailer.location = gc::ChunkLocationNursery;
c.trailer.runtime = runtime(); c.trailer.runtime = runtime();
} }

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

@ -335,39 +335,45 @@ StoreBuffer::addSizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf, JS::GCSi
JS_PUBLIC_API(void) JS_PUBLIC_API(void)
JS::HeapCellPostBarrier(js::gc::Cell **cellp) JS::HeapCellPostBarrier(js::gc::Cell **cellp)
{ {
JS_ASSERT(cellp);
JS_ASSERT(*cellp); JS_ASSERT(*cellp);
JSRuntime *runtime = (*cellp)->runtimeFromMainThread(); StoreBuffer *storeBuffer = (*cellp)->storeBuffer();
runtime->gc.storeBuffer.putRelocatableCell(cellp); if (storeBuffer)
storeBuffer->putRelocatableCellFromAnyThread(cellp);
} }
JS_PUBLIC_API(void) JS_PUBLIC_API(void)
JS::HeapCellRelocate(js::gc::Cell **cellp) JS::HeapCellRelocate(js::gc::Cell **cellp)
{ {
/* Called with old contents of *pp before overwriting. */ /* Called with old contents of *cellp before overwriting. */
JS_ASSERT(cellp);
JS_ASSERT(*cellp); JS_ASSERT(*cellp);
JSRuntime *runtime = (*cellp)->runtimeFromMainThread(); JSRuntime *runtime = (*cellp)->runtimeFromMainThread();
runtime->gc.storeBuffer.removeRelocatableCell(cellp); runtime->gc.storeBuffer.removeRelocatableCellFromAnyThread(cellp);
} }
JS_PUBLIC_API(void) JS_PUBLIC_API(void)
JS::HeapValuePostBarrier(JS::Value *valuep) JS::HeapValuePostBarrier(JS::Value *valuep)
{ {
JS_ASSERT(valuep);
JS_ASSERT(valuep->isMarkable()); JS_ASSERT(valuep->isMarkable());
if (valuep->isString() && StringIsPermanentAtom(valuep->toString())) if (valuep->isObject()) {
return; StoreBuffer *storeBuffer = valuep->toObject().storeBuffer();
JSRuntime *runtime = static_cast<js::gc::Cell *>(valuep->toGCThing())->runtimeFromMainThread(); if (storeBuffer)
runtime->gc.storeBuffer.putRelocatableValue(valuep); storeBuffer->putRelocatableValueFromAnyThread(valuep);
}
} }
JS_PUBLIC_API(void) JS_PUBLIC_API(void)
JS::HeapValueRelocate(JS::Value *valuep) JS::HeapValueRelocate(JS::Value *valuep)
{ {
/* Called with old contents of *valuep before overwriting. */ /* Called with old contents of *valuep before overwriting. */
JS_ASSERT(valuep);
JS_ASSERT(valuep->isMarkable()); JS_ASSERT(valuep->isMarkable());
if (valuep->isString() && StringIsPermanentAtom(valuep->toString())) if (valuep->isString() && valuep->toString()->isPermanentAtom())
return; return;
JSRuntime *runtime = static_cast<js::gc::Cell *>(valuep->toGCThing())->runtimeFromMainThread(); JSRuntime *runtime = static_cast<js::gc::Cell *>(valuep->toGCThing())->runtimeFromMainThread();
runtime->gc.storeBuffer.removeRelocatableValue(valuep); runtime->gc.storeBuffer.removeRelocatableValueFromAnyThread(valuep);
} }
template class StoreBuffer::MonoTypeBuffer<StoreBuffer::ValueEdge>; template class StoreBuffer::MonoTypeBuffer<StoreBuffer::ValueEdge>;

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

@ -244,7 +244,8 @@ class StoreBuffer
bool operator!=(const CellPtrEdge &other) const { return edge != other.edge; } bool operator!=(const CellPtrEdge &other) const { return edge != other.edge; }
bool maybeInRememberedSet(const Nursery &nursery) const { bool maybeInRememberedSet(const Nursery &nursery) const {
return !nursery.isInside(edge) && nursery.isInside(*edge); JS_ASSERT(nursery.isInside(*edge));
return !nursery.isInside(edge);
} }
void mark(JSTracer *trc); void mark(JSTracer *trc);
@ -267,7 +268,8 @@ class StoreBuffer
void *deref() const { return edge->isGCThing() ? edge->toGCThing() : nullptr; } void *deref() const { return edge->isGCThing() ? edge->toGCThing() : nullptr; }
bool maybeInRememberedSet(const Nursery &nursery) const { bool maybeInRememberedSet(const Nursery &nursery) const {
return !nursery.isInside(edge) && nursery.isInside(deref()); JS_ASSERT(nursery.isInside(deref()));
return !nursery.isInside(edge);
} }
void mark(JSTracer *trc); void mark(JSTracer *trc);
@ -362,8 +364,7 @@ class StoreBuffer
void *data; void *data;
}; };
template <typename Edge> bool isOkayToUseBuffer() const {
bool isOkayToUseBuffer(const Edge &edge) const {
/* /*
* Disabled store buffers may not have a valid state; e.g. when stored * Disabled store buffers may not have a valid state; e.g. when stored
* inline in the ChunkTrailer. * inline in the ChunkTrailer.
@ -382,8 +383,8 @@ class StoreBuffer
} }
template <typename Buffer, typename Edge> template <typename Buffer, typename Edge>
void put(Buffer &buffer, const Edge &edge) { void putFromAnyThread(Buffer &buffer, const Edge &edge) {
if (!isOkayToUseBuffer(edge)) if (!isOkayToUseBuffer())
return; return;
mozilla::ReentrancyGuard g(*this); mozilla::ReentrancyGuard g(*this);
if (edge.maybeInRememberedSet(nursery_)) if (edge.maybeInRememberedSet(nursery_))
@ -391,8 +392,8 @@ class StoreBuffer
} }
template <typename Buffer, typename Edge> template <typename Buffer, typename Edge>
void unput(Buffer &buffer, const Edge &edge) { void unputFromAnyThread(Buffer &buffer, const Edge &edge) {
if (!isOkayToUseBuffer(edge)) if (!isOkayToUseBuffer())
return; return;
mozilla::ReentrancyGuard g(*this); mozilla::ReentrancyGuard g(*this);
buffer.unput(this, edge); buffer.unput(this, edge);
@ -432,30 +433,38 @@ class StoreBuffer
bool isAboutToOverflow() const { return aboutToOverflow_; } bool isAboutToOverflow() const { return aboutToOverflow_; }
/* Insert a single edge into the buffer/remembered set. */ /* Insert a single edge into the buffer/remembered set. */
void putValue(JS::Value *valuep) { put(bufferVal, ValueEdge(valuep)); } void putValueFromAnyThread(JS::Value *valuep) { putFromAnyThread(bufferVal, ValueEdge(valuep)); }
void putCell(Cell **cellp) { put(bufferCell, CellPtrEdge(cellp)); } void putCellFromAnyThread(Cell **cellp) { putFromAnyThread(bufferCell, CellPtrEdge(cellp)); }
void putSlot(JSObject *obj, int kind, int32_t start, int32_t count) { void putSlotFromAnyThread(JSObject *obj, int kind, int32_t start, int32_t count) {
put(bufferSlot, SlotsEdge(obj, kind, start, count)); putFromAnyThread(bufferSlot, SlotsEdge(obj, kind, start, count));
} }
void putWholeCell(Cell *cell) { void putWholeCell(Cell *cell) {
JS_ASSERT(cell->isTenured()); JS_ASSERT(cell->isTenured());
put(bufferWholeCell, WholeCellEdges(cell)); putFromAnyThread(bufferWholeCell, WholeCellEdges(cell));
} }
/* Insert or update a single edge in the Relocatable buffer. */ /* Insert or update a single edge in the Relocatable buffer. */
void putRelocatableValue(JS::Value *valuep) { put(bufferRelocVal, ValueEdge(valuep)); } void putRelocatableValueFromAnyThread(JS::Value *valuep) {
void putRelocatableCell(Cell **cellp) { put(bufferRelocCell, CellPtrEdge(cellp)); } putFromAnyThread(bufferRelocVal, ValueEdge(valuep));
void removeRelocatableValue(JS::Value *valuep) { unput(bufferRelocVal, ValueEdge(valuep)); } }
void removeRelocatableCell(Cell **cellp) { unput(bufferRelocCell, CellPtrEdge(cellp)); } void removeRelocatableValueFromAnyThread(JS::Value *valuep) {
unputFromAnyThread(bufferRelocVal, ValueEdge(valuep));
}
void putRelocatableCellFromAnyThread(Cell **cellp) {
putFromAnyThread(bufferRelocCell, CellPtrEdge(cellp));
}
void removeRelocatableCellFromAnyThread(Cell **cellp) {
unputFromAnyThread(bufferRelocCell, CellPtrEdge(cellp));
}
/* Insert an entry into the generic buffer. */ /* Insert an entry into the generic buffer. */
template <typename T> template <typename T>
void putGeneric(const T &t) { put(bufferGeneric, t);} void putGeneric(const T &t) { putFromAnyThread(bufferGeneric, t);}
/* Insert or update a callback entry. */ /* Insert or update a callback entry. */
template <typename Key> template <typename Key>
void putCallback(void (*callback)(JSTracer *trc, Key *key, void *data), Key *key, void *data) { void putCallback(void (*callback)(JSTracer *trc, Key *key, void *data), Key *key, void *data) {
put(bufferGeneric, CallbackRef<Key>(callback, key, data)); putFromAnyThread(bufferGeneric, CallbackRef<Key>(callback, key, data));
} }
/* Methods to mark the source of all edges in the store buffer. */ /* Methods to mark the source of all edges in the store buffer. */

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

@ -247,12 +247,6 @@ Zone::createJitZone(JSContext *cx)
} }
#endif #endif
JS::Zone *
js::ZoneOfObject(const JSObject &obj)
{
return obj.zone();
}
JS::Zone * JS::Zone *
js::ZoneOfObjectFromAnyThread(const JSObject &obj) js::ZoneOfObjectFromAnyThread(const JSObject &obj)
{ {
@ -268,3 +262,12 @@ Zone::hasMarkedCompartments()
} }
return false; return false;
} }
JS::Zone *
js::ZoneOfValue(const JS::Value &value)
{
JS_ASSERT(value.isMarkable());
if (value.isObject())
return value.toObject().zone();
return static_cast<js::gc::Cell *>(value.toGCThing())->tenuredZone();
}

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

@ -474,6 +474,10 @@ class CompartmentsIterT
typedef CompartmentsIterT<ZonesIter> CompartmentsIter; typedef CompartmentsIterT<ZonesIter> CompartmentsIter;
/* Return the Zone* of a Value. Asserts if the Value is not a GC thing. */
Zone *
ZoneOfValue(const JS::Value &value);
} /* namespace js */ } /* namespace js */
#endif /* gc_Zone_h */ #endif /* gc_Zone_h */

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

@ -789,6 +789,7 @@ Chunk::init(JSRuntime *rt)
/* Initialize the chunk info. */ /* Initialize the chunk info. */
info.age = 0; info.age = 0;
info.trailer.storeBuffer = nullptr;
info.trailer.location = ChunkLocationTenuredHeap; info.trailer.location = ChunkLocationTenuredHeap;
info.trailer.runtime = rt; info.trailer.runtime = rt;

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

@ -2293,8 +2293,8 @@ JSObject::TradeGuts(JSContext *cx, JSObject *a, JSObject *b, TradeGutsReserved &
* below, in common with the other case. * below, in common with the other case.
*/ */
for (size_t i = 0; i < a->numFixedSlots(); ++i) { for (size_t i = 0; i < a->numFixedSlots(); ++i) {
HeapSlot::writeBarrierPost(cx->runtime(), a, HeapSlot::Slot, i, a->getSlot(i)); HeapSlot::writeBarrierPost(a, HeapSlot::Slot, i, a->getSlot(i));
HeapSlot::writeBarrierPost(cx->runtime(), b, HeapSlot::Slot, i, b->getSlot(i)); HeapSlot::writeBarrierPost(b, HeapSlot::Slot, i, b->getSlot(i));
} }
#endif #endif
} else { } else {

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

@ -187,7 +187,7 @@ DenseRangeWriteBarrierPost(JSRuntime *rt, JSObject *obj, uint32_t start, uint32_
#ifdef JSGC_GENERATIONAL #ifdef JSGC_GENERATIONAL
if (count > 0) { if (count > 0) {
JS::shadow::Runtime *shadowRuntime = JS::shadow::Runtime::asShadowRuntime(rt); JS::shadow::Runtime *shadowRuntime = JS::shadow::Runtime::asShadowRuntime(rt);
shadowRuntime->gcStoreBufferPtr()->putSlot(obj, HeapSlot::Element, start, count); shadowRuntime->gcStoreBufferPtr()->putSlotFromAnyThread(obj, HeapSlot::Element, start, count);
} }
#endif #endif
} }

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

@ -223,12 +223,13 @@ JSObject::ensureDenseInitializedLengthNoPackedCheck(js::ThreadSafeContext *cx, u
uint32_t &initlen = getElementsHeader()->initializedLength; uint32_t &initlen = getElementsHeader()->initializedLength;
if (initlen < index + extra) { if (initlen < index + extra) {
JSRuntime *rt = runtimeFromAnyThread();
size_t offset = initlen; size_t offset = initlen;
for (js::HeapSlot *sp = elements + initlen; for (js::HeapSlot *sp = elements + initlen;
sp != elements + (index + extra); sp != elements + (index + extra);
sp++, offset++) sp++, offset++)
sp->init(rt, this, js::HeapSlot::Element, offset, js::MagicValue(JS_ELEMENTS_HOLE)); {
sp->init(this, js::HeapSlot::Element, offset, js::MagicValue(JS_ELEMENTS_HOLE));
}
initlen = index + extra; initlen = index + extra;
} }
} }

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

@ -264,24 +264,22 @@ js::ObjectImpl::initializeSlotRange(uint32_t start, uint32_t length)
HeapSlot *fixedStart, *fixedEnd, *slotsStart, *slotsEnd; HeapSlot *fixedStart, *fixedEnd, *slotsStart, *slotsEnd;
getSlotRangeUnchecked(start, length, &fixedStart, &fixedEnd, &slotsStart, &slotsEnd); getSlotRangeUnchecked(start, length, &fixedStart, &fixedEnd, &slotsStart, &slotsEnd);
JSRuntime *rt = runtimeFromAnyThread();
uint32_t offset = start; uint32_t offset = start;
for (HeapSlot *sp = fixedStart; sp < fixedEnd; sp++) for (HeapSlot *sp = fixedStart; sp < fixedEnd; sp++)
sp->init(rt, this->asObjectPtr(), HeapSlot::Slot, offset++, UndefinedValue()); sp->init(this->asObjectPtr(), HeapSlot::Slot, offset++, UndefinedValue());
for (HeapSlot *sp = slotsStart; sp < slotsEnd; sp++) for (HeapSlot *sp = slotsStart; sp < slotsEnd; sp++)
sp->init(rt, this->asObjectPtr(), HeapSlot::Slot, offset++, UndefinedValue()); sp->init(this->asObjectPtr(), HeapSlot::Slot, offset++, UndefinedValue());
} }
void void
js::ObjectImpl::initSlotRange(uint32_t start, const Value *vector, uint32_t length) js::ObjectImpl::initSlotRange(uint32_t start, const Value *vector, uint32_t length)
{ {
JSRuntime *rt = runtimeFromAnyThread();
HeapSlot *fixedStart, *fixedEnd, *slotsStart, *slotsEnd; HeapSlot *fixedStart, *fixedEnd, *slotsStart, *slotsEnd;
getSlotRange(start, length, &fixedStart, &fixedEnd, &slotsStart, &slotsEnd); getSlotRange(start, length, &fixedStart, &fixedEnd, &slotsStart, &slotsEnd);
for (HeapSlot *sp = fixedStart; sp < fixedEnd; sp++) for (HeapSlot *sp = fixedStart; sp < fixedEnd; sp++)
sp->init(rt, this->asObjectPtr(), HeapSlot::Slot, start++, *vector++); sp->init(this->asObjectPtr(), HeapSlot::Slot, start++, *vector++);
for (HeapSlot *sp = slotsStart; sp < slotsEnd; sp++) for (HeapSlot *sp = slotsStart; sp < slotsEnd; sp++)
sp->init(rt, this->asObjectPtr(), HeapSlot::Slot, start++, *vector++); sp->init(this->asObjectPtr(), HeapSlot::Slot, start++, *vector++);
} }
void void

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

@ -840,7 +840,12 @@ class ObjectImpl : public gc::BarrieredCell<ObjectImpl>
void privateWriteBarrierPost(void **pprivate) { void privateWriteBarrierPost(void **pprivate) {
#ifdef JSGC_GENERATIONAL #ifdef JSGC_GENERATIONAL
shadowRuntimeFromAnyThread()->gcStoreBufferPtr()->putCell(reinterpret_cast<js::gc::Cell **>(pprivate)); js::gc::Cell **cellp = reinterpret_cast<js::gc::Cell **>(pprivate);
JS_ASSERT(cellp);
JS_ASSERT(*cellp);
js::gc::StoreBuffer *storeBuffer = (*cellp)->storeBuffer();
if (storeBuffer)
storeBuffer->putCellFromAnyThread(cellp);
#endif #endif
} }
@ -944,30 +949,43 @@ BarrieredCell<ObjectImpl>::isNullLike(ObjectImpl *obj)
template<> template<>
/* static */ inline void /* static */ inline void
BarrieredCell<ObjectImpl>::writeBarrierPost(ObjectImpl *obj, void *addr) BarrieredCell<ObjectImpl>::writeBarrierPost(ObjectImpl *obj, void *cellp)
{ {
JS_ASSERT(cellp);
#ifdef JSGC_GENERATIONAL #ifdef JSGC_GENERATIONAL
if (IsNullTaggedPointer(obj)) if (IsNullTaggedPointer(obj))
return; return;
obj->shadowRuntimeFromAnyThread()->gcStoreBufferPtr()->putCell((Cell **)addr); JS_ASSERT(obj == *static_cast<ObjectImpl **>(cellp));
gc::StoreBuffer *storeBuffer = obj->storeBuffer();
if (storeBuffer)
storeBuffer->putCellFromAnyThread(static_cast<Cell **>(cellp));
#endif #endif
} }
template<> template<>
/* static */ inline void /* static */ inline void
BarrieredCell<ObjectImpl>::writeBarrierPostRelocate(ObjectImpl *obj, void *addr) BarrieredCell<ObjectImpl>::writeBarrierPostRelocate(ObjectImpl *obj, void *cellp)
{ {
JS_ASSERT(cellp);
JS_ASSERT(obj);
JS_ASSERT(obj == *static_cast<ObjectImpl **>(cellp));
#ifdef JSGC_GENERATIONAL #ifdef JSGC_GENERATIONAL
obj->shadowRuntimeFromAnyThread()->gcStoreBufferPtr()->putRelocatableCell((Cell **)addr); gc::StoreBuffer *storeBuffer = obj->storeBuffer();
if (storeBuffer)
storeBuffer->putRelocatableCellFromAnyThread(static_cast<Cell **>(cellp));
#endif #endif
} }
template<> template<>
/* static */ inline void /* static */ inline void
BarrieredCell<ObjectImpl>::writeBarrierPostRemove(ObjectImpl *obj, void *addr) BarrieredCell<ObjectImpl>::writeBarrierPostRemove(ObjectImpl *obj, void *cellp)
{ {
JS_ASSERT(cellp);
JS_ASSERT(obj);
JS_ASSERT(obj == *static_cast<ObjectImpl **>(cellp));
#ifdef JSGC_GENERATIONAL #ifdef JSGC_GENERATIONAL
obj->shadowRuntimeFromAnyThread()->gcStoreBufferPtr()->removeRelocatableCell((Cell **)addr); obj->shadowRuntimeFromAnyThread()->gcStoreBufferPtr()->removeRelocatableCellFromAnyThread(
static_cast<Cell **>(cellp));
#endif #endif
} }

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

@ -525,8 +525,12 @@ static inline void
GetterSetterWriteBarrierPost(JSRuntime *rt, JSObject **objp) GetterSetterWriteBarrierPost(JSRuntime *rt, JSObject **objp)
{ {
#ifdef JSGC_GENERATIONAL #ifdef JSGC_GENERATIONAL
JS::shadow::Runtime *shadowRuntime = JS::shadow::Runtime::asShadowRuntime(rt); JS_ASSERT(objp);
shadowRuntime->gcStoreBufferPtr()->putRelocatableCell(reinterpret_cast<gc::Cell **>(objp)); JS_ASSERT(*objp);
gc::Cell **cellp = reinterpret_cast<gc::Cell **>(objp);
gc::StoreBuffer *storeBuffer = (*cellp)->storeBuffer();
if (storeBuffer)
storeBuffer->putRelocatableCellFromAnyThread(cellp);
#endif #endif
} }
@ -535,7 +539,7 @@ GetterSetterWriteBarrierPostRemove(JSRuntime *rt, JSObject **objp)
{ {
#ifdef JSGC_GENERATIONAL #ifdef JSGC_GENERATIONAL
JS::shadow::Runtime *shadowRuntime = JS::shadow::Runtime::asShadowRuntime(rt); JS::shadow::Runtime *shadowRuntime = JS::shadow::Runtime::asShadowRuntime(rt);
shadowRuntime->gcStoreBufferPtr()->removeRelocatableCell(reinterpret_cast<gc::Cell **>(objp)); shadowRuntime->gcStoreBufferPtr()->removeRelocatableCellFromAnyThread(reinterpret_cast<gc::Cell **>(objp));
#endif #endif
} }

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

@ -139,15 +139,15 @@ InterpreterFrame::writeBarrierPost()
{ {
/* This needs to follow the same rules as in InterpreterFrame::mark. */ /* This needs to follow the same rules as in InterpreterFrame::mark. */
if (scopeChain_) if (scopeChain_)
JSObject::writeBarrierPost(scopeChain_, (void *)&scopeChain_); JSObject::writeBarrierPost(scopeChain_, &scopeChain_);
if (flags_ & HAS_ARGS_OBJ) if (flags_ & HAS_ARGS_OBJ)
JSObject::writeBarrierPost(argsObj_, (void *)&argsObj_); JSObject::writeBarrierPost(argsObj_, &argsObj_);
if (isFunctionFrame()) { if (isFunctionFrame()) {
JSFunction::writeBarrierPost(exec.fun, (void *)&exec.fun); JSFunction::writeBarrierPost(exec.fun, &exec.fun);
if (isEvalFrame()) if (isEvalFrame())
JSScript::writeBarrierPost(u.evalScript, (void *)&u.evalScript); JSScript::writeBarrierPost(u.evalScript, &u.evalScript);
} else { } else {
JSScript::writeBarrierPost(exec.script, (void *)&exec.script); JSScript::writeBarrierPost(exec.script, &exec.script);
} }
if (hasReturnValue()) if (hasReturnValue())
HeapValue::writeBarrierPost(rval_, &rval_); HeapValue::writeBarrierPost(rval_, &rval_);

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

@ -3,21 +3,16 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
JS_FILES = \ componentdir = js/xpconnect/tests/components/js
JS_FILES := \
xpctest_attributes.js \ xpctest_attributes.js \
xpctest_bug809674.js \ xpctest_bug809674.js \
xpctest_interfaces.js \ xpctest_interfaces.js \
xpctest_params.js \ xpctest_params.js \
xpctest.manifest \
$(NULL) $(NULL)
JS_DEST = $(testxpcobjdir)/$(componentdir)
MANIFEST_FILE = xpctest.manifest INSTALL_TARGETS += JS
include $(topsrcdir)/config/rules.mk include $(topsrcdir)/config/rules.mk
componentdir = js/xpconnect/tests/components/js
libs:: $(JS_FILES)
$(INSTALL) $^ $(testxpcobjdir)/$(componentdir)
libs:: $(MANIFEST_FILE)
$(call py_action,preprocessor,$(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $< -o $(testxpcobjdir)/$(componentdir)/$(<F))

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

@ -653,6 +653,11 @@ nsresult MediaPipelineTransmit::Init() {
listener_->direct_connect_ = true; listener_->direct_connect_ = true;
} }
#ifndef MOZILLA_INTERNAL_API
// this enables the unit tests that can't fiddle with principals and the like
listener_->SetEnabled(true);
#endif
return MediaPipeline::Init(); return MediaPipeline::Init();
} }

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

@ -1330,12 +1330,17 @@ void CreateAnswer(sipcc::MediaConstraints& constraints, std::string offer,
mozilla::RefPtr<mozilla::MediaPipeline> GetMediaPipeline( mozilla::RefPtr<mozilla::MediaPipeline> GetMediaPipeline(
bool local, int stream, int track) { bool local, int stream, int track) {
sipcc::SourceStreamInfo *streamInfo; sipcc::SourceStreamInfo* streamInfo;
if (local) { if (local) {
streamInfo = pc->media()->GetLocalStream(stream); mozilla::SyncRunnable::DispatchToThread(
gMainThread, WrapRunnableRet(
pc->media(), &sipcc::PeerConnectionMedia::GetLocalStream,
stream, &streamInfo));
} else { } else {
streamInfo = pc->media()->GetRemoteStream(stream); mozilla::SyncRunnable::DispatchToThread(
gMainThread, WrapRunnableRet(
pc->media(), &sipcc::PeerConnectionMedia::GetRemoteStream,
stream, &streamInfo));
} }
if (!streamInfo) { if (!streamInfo) {

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

@ -9,10 +9,17 @@
#ifndef mozilla_Assertions_h #ifndef mozilla_Assertions_h
#define mozilla_Assertions_h #define mozilla_Assertions_h
#if defined(MOZILLA_INTERNAL_API) && defined(__cplusplus)
#define MOZ_DUMP_ASSERTION_STACK
#endif
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
#include "mozilla/Compiler.h" #include "mozilla/Compiler.h"
#include "mozilla/Likely.h" #include "mozilla/Likely.h"
#include "mozilla/MacroArgs.h" #include "mozilla/MacroArgs.h"
#ifdef MOZ_DUMP_ASSERTION_STACK
#include "nsTraceRefcnt.h"
#endif
#include <stddef.h> #include <stddef.h>
#include <stdio.h> #include <stdio.h>
@ -132,6 +139,9 @@ MOZ_ReportAssertionFailure(const char* s, const char* file, int ln)
"Assertion failure: %s, at %s:%d\n", s, file, ln); "Assertion failure: %s, at %s:%d\n", s, file, ln);
#else #else
fprintf(stderr, "Assertion failure: %s, at %s:%d\n", s, file, ln); fprintf(stderr, "Assertion failure: %s, at %s:%d\n", s, file, ln);
#ifdef MOZ_DUMP_ASSERTION_STACK
nsTraceRefcnt::WalkTheStack(stderr);
#endif
fflush(stderr); fflush(stderr);
#endif #endif
} }
@ -144,6 +154,9 @@ MOZ_ReportCrash(const char* s, const char* file, int ln)
"Hit MOZ_CRASH(%s) at %s:%d\n", s, file, ln); "Hit MOZ_CRASH(%s) at %s:%d\n", s, file, ln);
#else #else
fprintf(stderr, "Hit MOZ_CRASH(%s) at %s:%d\n", s, file, ln); fprintf(stderr, "Hit MOZ_CRASH(%s) at %s:%d\n", s, file, ln);
#ifdef MOZ_DUMP_ASSERTION_STACK
nsTraceRefcnt::WalkTheStack(stderr);
#endif
fflush(stderr); fflush(stderr);
#endif #endif
} }
@ -484,4 +497,6 @@ void ValidateAssertConditionType()
# define MOZ_ALWAYS_FALSE(expr) ((void)(expr)) # define MOZ_ALWAYS_FALSE(expr) ((void)(expr))
#endif #endif
#undef MOZ_DUMP_ASSERTION_STACK
#endif /* mozilla_Assertions_h */ #endif /* mozilla_Assertions_h */

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

@ -757,7 +757,7 @@ Http2Session::GenerateGoAway(uint32_t aStatusCode)
// last-good-stream-id are bytes 8-11 reflecting pushes // last-good-stream-id are bytes 8-11 reflecting pushes
uint32_t goAway = PR_htonl(mOutgoingGoAwayID); uint32_t goAway = PR_htonl(mOutgoingGoAwayID);
memcpy (packet + 7, &goAway, 4); memcpy(packet + 8, &goAway, 4);
// bytes 12-15 are the status code. // bytes 12-15 are the status code.
aStatusCode = PR_htonl(aStatusCode); aStatusCode = PR_htonl(aStatusCode);

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

@ -161,10 +161,9 @@ static struct sock_filter seccomp_filter[] = {
#endif #endif
ALLOW_SYSCALL(rt_sigprocmask), ALLOW_SYSCALL(rt_sigprocmask),
/* System calls used by the profiler */ // Used by profiler. Also used for raise(), which causes problems
#ifdef MOZ_PROFILING // with Android KitKat abort(); see bug 1004832.
ALLOW_SYSCALL(tgkill), ALLOW_SYSCALL(tgkill),
#endif
/* B2G specific low-frequency syscalls */ /* B2G specific low-frequency syscalls */
#ifdef MOZ_WIDGET_GONK #ifdef MOZ_WIDGET_GONK

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

@ -25,7 +25,9 @@ testing_modules := \
utils.js \ utils.js \
$(NULL) $(NULL)
PREF_JS_EXPORTS = $(srcdir)/services-common.js JS_EXPORTS_FILES := $(srcdir)/services-common.js
JS_EXPORTS_DEST = $(FINAL_TARGET)/$(PREF_DIR)
INSTALL_TARGETS += JS_EXPORTS
MODULES_FILES := $(modules) MODULES_FILES := $(modules)
MODULES_DEST = $(FINAL_TARGET)/modules/services-common MODULES_DEST = $(FINAL_TARGET)/modules/services-common

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

@ -62,7 +62,9 @@ sync_testing_modules := \
fxa_utils.js \ fxa_utils.js \
$(NULL) $(NULL)
PREF_JS_EXPORTS := $(srcdir)/services-sync.js JS_EXPORTS_FILES := $(srcdir)/services-sync.js
JS_EXPORTS_DEST = $(FINAL_TARGET)/$(PREF_DIR)
INSTALL_TARGETS += JS_EXPORTS
# Install JS module files. # Install JS module files.
SYNC_MAIN_FILES := $(addprefix modules/,$(sync_modules)) SYNC_MAIN_FILES := $(addprefix modules/,$(sync_modules))

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

@ -4,7 +4,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
LIBS += $(MOZ_COMPONENT_LIBS) LIBS += $(MOZ_COMPONENT_LIBS)
DIST_FILES += \ DIST_FILES_NO_PP += \
$(srcdir)/TestStartupCacheTelemetry.manifest \ $(srcdir)/TestStartupCacheTelemetry.manifest \
$(srcdir)/TestStartupCacheTelemetry.js \ $(srcdir)/TestStartupCacheTelemetry.js \
$(NULL) $(NULL)

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

@ -144,11 +144,6 @@ user_pref("network.http.bypass-cachelock-threshold", 200000);
user_pref("dom.gamepad.enabled", true); user_pref("dom.gamepad.enabled", true);
user_pref("dom.gamepad.non_standard_events.enabled", true); user_pref("dom.gamepad.non_standard_events.enabled", true);
// Enable Web Audio legacy APIs
user_pref("media.webaudio.legacy.BiquadFilterNode", true);
user_pref("media.webaudio.legacy.PannerNode", true);
user_pref("media.webaudio.legacy.OscillatorNode", true);
// Always use network provider for geolocation tests // Always use network provider for geolocation tests
// so we bypass the OSX dialog raised by the corelocation provider // so we bypass the OSX dialog raised by the corelocation provider
user_pref("geo.provider.testing", true); user_pref("geo.provider.testing", true);

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

@ -8,6 +8,9 @@ NO_JS_MANIFEST = 1
DIST_FILES = \ DIST_FILES = \
install.rdf \ install.rdf \
$(NULL)
DIST_FILES_NO_PP = \
chrome.manifest \ chrome.manifest \
$(NULL) $(NULL)

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

@ -7,9 +7,9 @@
LIBRARY_NAME = 'xpt' LIBRARY_NAME = 'xpt'
UNIFIED_SOURCES += [ UNIFIED_SOURCES += [
'xpt_arena.c', 'xpt_arena.cpp',
'xpt_struct.c', 'xpt_struct.cpp',
'xpt_xdr.c', 'xpt_xdr.cpp',
] ]
FINAL_LIBRARY = 'xpcom_core' FINAL_LIBRARY = 'xpcom_core'

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

@ -105,7 +105,7 @@ struct XPTArena
XPT_PUBLIC_API(XPTArena *) XPT_PUBLIC_API(XPTArena *)
XPT_NewArena(uint32_t block_size, size_t alignment, const char* name) XPT_NewArena(uint32_t block_size, size_t alignment, const char* name)
{ {
XPTArena *arena = calloc(1, sizeof(XPTArena)); XPTArena *arena = (XPTArena*)calloc(1, sizeof(XPTArena));
if (arena) { if (arena) {
XPT_ASSERT(alignment); XPT_ASSERT(alignment);
if (alignment > sizeof(double)) if (alignment > sizeof(double))
@ -244,7 +244,7 @@ XPT_ArenaStrDup(XPTArena *arena, const char * s)
return NULL; return NULL;
len = strlen(s)+1; len = strlen(s)+1;
cur = XPT_ArenaMalloc(arena, len); cur = (char*)XPT_ArenaMalloc(arena, len);
memcpy(cur, s, len); memcpy(cur, s, len);
return cur; return cur;
} }

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

@ -98,8 +98,8 @@ XPT_NewHeader(XPTArena *arena, uint16_t num_interfaces, uint8_t major_version, u
header->num_interfaces = num_interfaces; header->num_interfaces = num_interfaces;
if (num_interfaces) { if (num_interfaces) {
header->interface_directory = header->interface_directory =
XPT_CALLOC(arena, (XPTInterfaceDirectoryEntry*)XPT_CALLOC(arena,
num_interfaces * sizeof(XPTInterfaceDirectoryEntry)); num_interfaces * sizeof(XPTInterfaceDirectoryEntry));
if (!header->interface_directory) { if (!header->interface_directory) {
XPT_DELETE(arena, header); XPT_DELETE(arena, header);
return NULL; return NULL;
@ -207,7 +207,6 @@ XPT_DoHeaderPrologue(XPTArena *arena, XPTCursor *cursor, XPTHeader **headerp, ui
XPT_PUBLIC_API(PRBool) XPT_PUBLIC_API(PRBool)
XPT_DoHeader(XPTArena *arena, XPTCursor *cursor, XPTHeader **headerp) XPT_DoHeader(XPTArena *arena, XPTCursor *cursor, XPTHeader **headerp)
{ {
const int HEADER_SIZE = 24;
XPTMode mode = cursor->state->mode; XPTMode mode = cursor->state->mode;
XPTHeader * header; XPTHeader * header;
uint32_t ide_offset; uint32_t ide_offset;
@ -237,8 +236,8 @@ XPT_DoHeader(XPTArena *arena, XPTCursor *cursor, XPTHeader **headerp)
if (mode == XPT_DECODE && header->num_interfaces) { if (mode == XPT_DECODE && header->num_interfaces) {
header->interface_directory = header->interface_directory =
XPT_CALLOC(arena, header->num_interfaces * (XPTInterfaceDirectoryEntry*)XPT_CALLOC(arena, header->num_interfaces *
sizeof(XPTInterfaceDirectoryEntry)); sizeof(XPTInterfaceDirectoryEntry));
if (!header->interface_directory) if (!header->interface_directory)
goto error; goto error;
} }
@ -347,16 +346,16 @@ XPT_NewInterfaceDescriptor(XPTArena *arena,
return NULL; return NULL;
if (num_methods) { if (num_methods) {
id->method_descriptors = XPT_CALLOC(arena, num_methods * id->method_descriptors = (XPTMethodDescriptor*)XPT_CALLOC(arena, num_methods *
sizeof(XPTMethodDescriptor)); sizeof(XPTMethodDescriptor));
if (!id->method_descriptors) if (!id->method_descriptors)
goto free_id; goto free_id;
id->num_methods = num_methods; id->num_methods = num_methods;
} }
if (num_constants) { if (num_constants) {
id->const_descriptors = XPT_CALLOC(arena, num_constants * id->const_descriptors = (XPTConstDescriptor*)XPT_CALLOC(arena, num_constants *
sizeof(XPTConstDescriptor)); sizeof(XPTConstDescriptor));
if (!id->const_descriptors) if (!id->const_descriptors)
goto free_meth; goto free_meth;
id->num_constants = num_constants; id->num_constants = num_constants;
@ -415,20 +414,20 @@ XPT_InterfaceDescriptorAddTypes(XPTArena *arena, XPTInterfaceDescriptor *id,
uint16_t num) uint16_t num)
{ {
XPTTypeDescriptor *old = id->additional_types; XPTTypeDescriptor *old = id->additional_types;
XPTTypeDescriptor *new; XPTTypeDescriptor *new_;
size_t old_size = id->num_additional_types * sizeof(XPTTypeDescriptor); size_t old_size = id->num_additional_types * sizeof(XPTTypeDescriptor);
size_t new_size = (num * sizeof(XPTTypeDescriptor)) + old_size; size_t new_size = (num * sizeof(XPTTypeDescriptor)) + old_size;
/* XXX should grow in chunks to minimize alloc overhead */ /* XXX should grow in chunks to minimize alloc overhead */
new = XPT_CALLOC(arena, new_size); new_ = (XPTTypeDescriptor*)XPT_CALLOC(arena, new_size);
if (!new) if (!new_)
return PR_FALSE; return PR_FALSE;
if (old) { if (old) {
if (old_size) if (old_size)
memcpy(new, old, old_size); memcpy(new_, old, old_size);
XPT_FREE(arena, old); XPT_FREE(arena, old);
} }
id->additional_types = new; id->additional_types = new_;
id->num_additional_types += num; id->num_additional_types += num;
return PR_TRUE; return PR_TRUE;
} }
@ -438,20 +437,20 @@ XPT_InterfaceDescriptorAddMethods(XPTArena *arena, XPTInterfaceDescriptor *id,
uint16_t num) uint16_t num)
{ {
XPTMethodDescriptor *old = id->method_descriptors; XPTMethodDescriptor *old = id->method_descriptors;
XPTMethodDescriptor *new; XPTMethodDescriptor *new_;
size_t old_size = id->num_methods * sizeof(XPTMethodDescriptor); size_t old_size = id->num_methods * sizeof(XPTMethodDescriptor);
size_t new_size = (num * sizeof(XPTMethodDescriptor)) + old_size; size_t new_size = (num * sizeof(XPTMethodDescriptor)) + old_size;
/* XXX should grow in chunks to minimize alloc overhead */ /* XXX should grow in chunks to minimize alloc overhead */
new = XPT_CALLOC(arena, new_size); new_ = (XPTMethodDescriptor*)XPT_CALLOC(arena, new_size);
if (!new) if (!new_)
return PR_FALSE; return PR_FALSE;
if (old) { if (old) {
if (old_size) if (old_size)
memcpy(new, old, old_size); memcpy(new_, old, old_size);
XPT_FREE(arena, old); XPT_FREE(arena, old);
} }
id->method_descriptors = new; id->method_descriptors = new_;
id->num_methods += num; id->num_methods += num;
return PR_TRUE; return PR_TRUE;
} }
@ -461,20 +460,20 @@ XPT_InterfaceDescriptorAddConsts(XPTArena *arena, XPTInterfaceDescriptor *id,
uint16_t num) uint16_t num)
{ {
XPTConstDescriptor *old = id->const_descriptors; XPTConstDescriptor *old = id->const_descriptors;
XPTConstDescriptor *new; XPTConstDescriptor *new_;
size_t old_size = id->num_constants * sizeof(XPTConstDescriptor); size_t old_size = id->num_constants * sizeof(XPTConstDescriptor);
size_t new_size = (num * sizeof(XPTConstDescriptor)) + old_size; size_t new_size = (num * sizeof(XPTConstDescriptor)) + old_size;
/* XXX should grow in chunks to minimize alloc overhead */ /* XXX should grow in chunks to minimize alloc overhead */
new = XPT_CALLOC(arena, new_size); new_ = (XPTConstDescriptor*)XPT_CALLOC(arena, new_size);
if (!new) if (!new_)
return PR_FALSE; return PR_FALSE;
if (old) { if (old) {
if (old_size) if (old_size)
memcpy(new, old, old_size); memcpy(new_, old, old_size);
XPT_FREE(arena, old); XPT_FREE(arena, old);
} }
id->const_descriptors = new; id->const_descriptors = new_;
id->num_constants += num; id->num_constants += num;
return PR_TRUE; return PR_TRUE;
} }
@ -604,8 +603,8 @@ DoInterfaceDescriptor(XPTArena *arena, XPTCursor *outer,
} }
if (mode == XPT_DECODE && id->num_methods) { if (mode == XPT_DECODE && id->num_methods) {
id->method_descriptors = XPT_CALLOC(arena, id->num_methods * id->method_descriptors = (XPTMethodDescriptor*)XPT_CALLOC(arena, id->num_methods *
sizeof(XPTMethodDescriptor)); sizeof(XPTMethodDescriptor));
if (!id->method_descriptors) if (!id->method_descriptors)
goto error; goto error;
} }
@ -620,8 +619,8 @@ DoInterfaceDescriptor(XPTArena *arena, XPTCursor *outer,
} }
if (mode == XPT_DECODE && id->num_constants) { if (mode == XPT_DECODE && id->num_constants) {
id->const_descriptors = XPT_CALLOC(arena, id->num_constants * id->const_descriptors = (XPTConstDescriptor*)XPT_CALLOC(arena, id->num_constants *
sizeof(XPTConstDescriptor)); sizeof(XPTConstDescriptor));
if (!id->const_descriptors) if (!id->const_descriptors)
goto error; goto error;
} }
@ -704,7 +703,7 @@ XPT_FillMethodDescriptor(XPTArena *arena, XPTMethodDescriptor *meth,
return PR_FALSE; return PR_FALSE;
meth->num_args = num_args; meth->num_args = num_args;
if (num_args) { if (num_args) {
meth->params = XPT_CALLOC(arena, num_args * sizeof(XPTParamDescriptor)); meth->params = (XPTParamDescriptor*)XPT_CALLOC(arena, num_args * sizeof(XPTParamDescriptor));
if (!meth->params) if (!meth->params)
goto free_name; goto free_name;
} else { } else {
@ -712,7 +711,6 @@ XPT_FillMethodDescriptor(XPTArena *arena, XPTMethodDescriptor *meth,
} }
return PR_TRUE; return PR_TRUE;
free_params:
XPT_DELETE(arena, meth->params); XPT_DELETE(arena, meth->params);
free_name: free_name:
XPT_DELETE(arena, meth->name); XPT_DELETE(arena, meth->name);
@ -732,7 +730,7 @@ DoMethodDescriptor(XPTArena *arena, XPTCursor *cursor, XPTMethodDescriptor *md,
return PR_FALSE; return PR_FALSE;
if (mode == XPT_DECODE && md->num_args) { if (mode == XPT_DECODE && md->num_args) {
md->params = XPT_CALLOC(arena, md->num_args * sizeof(XPTParamDescriptor)); md->params = (XPTParamDescriptor*)XPT_CALLOC(arena, md->num_args * sizeof(XPTParamDescriptor));
if (!md->params) if (!md->params)
return PR_FALSE; return PR_FALSE;
} }

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

@ -167,7 +167,7 @@ XPT_NewXDRState(XPTMode mode, char *data, uint32_t len)
state->pool->data = data; state->pool->data = data;
state->pool->allocated = len; state->pool->allocated = len;
} else { } else {
state->pool->data = XPT_MALLOC(arena, XPT_GROW_CHUNK); state->pool->data = (char*)XPT_MALLOC(arena, XPT_GROW_CHUNK);
if (!state->pool->data) if (!state->pool->data)
goto err_free_hash; goto err_free_hash;
state->pool->allocated = XPT_GROW_CHUNK; state->pool->allocated = XPT_GROW_CHUNK;
@ -249,7 +249,7 @@ GrowPool(XPTArena *arena, XPTDatapool *pool, uint32_t old_size,
total_size = at_least; total_size = at_least;
} }
newdata = XPT_MALLOC(arena, total_size); newdata = (char*)XPT_MALLOC(arena, total_size);
if (!newdata) if (!newdata)
return PR_FALSE; return PR_FALSE;
if (pool->data) { if (pool->data) {
@ -312,7 +312,7 @@ XPT_NewString(XPTArena *arena, uint16_t length, char *bytes)
return NULL; return NULL;
str->length = length; str->length = length;
/* Alloc one extra to store the trailing nul. */ /* Alloc one extra to store the trailing nul. */
str->bytes = XPT_MALLOC(arena, length + 1u); str->bytes = (char*)XPT_MALLOC(arena, length + 1u);
if (!str->bytes) { if (!str->bytes) {
XPT_DELETE(arena, str); XPT_DELETE(arena, str);
return NULL; return NULL;
@ -350,7 +350,7 @@ XPT_DoStringInline(XPTArena *arena, XPTCursor *cursor, XPTString **strp)
goto error; goto error;
if (mode == XPT_DECODE) if (mode == XPT_DECODE)
if (!(str->bytes = XPT_MALLOC(arena, str->length + 1u))) if (!(str->bytes = (char*)XPT_MALLOC(arena, str->length + 1u)))
goto error; goto error;
for (i = 0; i < str->length; i++) for (i = 0; i < str->length; i++)
@ -415,7 +415,7 @@ XPT_DoCString(XPTArena *arena, XPTCursor *cursor, char **identp)
len = end - start; len = end - start;
XPT_ASSERT(len > 0); XPT_ASSERT(len > 0);
ident = XPT_MALLOC(arena, len + 1u); ident = (char*)XPT_MALLOC(arena, len + 1u);
if (!ident) if (!ident)
return PR_FALSE; return PR_FALSE;

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

@ -5,6 +5,7 @@
LIBS = \ LIBS = \
$(DIST)/lib/$(LIB_PREFIX)xpt.$(LIB_SUFFIX) \ $(DIST)/lib/$(LIB_PREFIX)xpt.$(LIB_SUFFIX) \
$(XPCOM_LIBS) \
$(NULL) $(NULL)
include $(topsrcdir)/config/rules.mk include $(topsrcdir)/config/rules.mk

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

@ -38,7 +38,7 @@ struct TestData {
output = {0, 0, {0, 0}, NULL, NULL }; output = {0, 0, {0, 0}, NULL, NULL };
void void
dump_struct(char *label, struct TestData *str) dump_struct(const char *label, struct TestData *str)
{ {
fprintf(stderr, "%s: {%#08x, %#04x, {%#02x, %#02x}, %s, %d/%s}\n", fprintf(stderr, "%s: {%#08x, %#04x, {%#02x, %#02x}, %s, %d/%s}\n",
label, str->bit32, str->bit16, str->bit8[0], str->bit8[1], label, str->bit32, str->bit16, str->bit8[0], str->bit8[1],
@ -96,7 +96,7 @@ main(int argc, char **argv)
(uint8_t)data[i]); (uint8_t)data[i]);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
whole = malloc(dlen + hlen); whole = (char*)malloc(dlen + hlen);
if (!whole) { if (!whole) {
fprintf(stderr, "malloc %d failed!\n", dlen + hlen); fprintf(stderr, "malloc %d failed!\n", dlen + hlen);
return 1; return 1;

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

@ -10,5 +10,5 @@ SIMPLE_PROGRAMS = [
] ]
SOURCES += [ SOURCES += [
'%s.c' % s for s in SIMPLE_PROGRAMS '%s.cpp' % s for s in SIMPLE_PROGRAMS
] ]