зеркало из https://github.com/mozilla/gecko-dev.git
merge mozilla-inbound to mozilla-central
This commit is contained in:
Коммит
751727a836
2
CLOBBER
2
CLOBBER
|
@ -22,4 +22,4 @@
|
|||
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
|
||||
# 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
|
||||
endif
|
||||
|
||||
ifneq ($(DIST_CHROME_FILES),)
|
||||
DIST_CHROME_FILES_PATH := $(FINAL_TARGET)/chrome
|
||||
DIST_CHROME_FILES_FLAGS := $(XULAPP_DEFINES)
|
||||
PP_TARGETS += DIST_CHROME_FILES
|
||||
ifneq ($(DIST_FILES_NO_PP),)
|
||||
_DIST_FILES := $(DIST_FILES_NO_PP)
|
||||
_DIST_DEST := $(FINAL_TARGET)
|
||||
INSTALL_TARGETS += _DIST
|
||||
endif
|
||||
|
||||
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="email" id="input_email" onchange="++textInputChange[1];"></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="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 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 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="email" id="input_email" oninput="++textInput[1];"></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="password" id="input_password" oninput="++textInput[5];"></input>
|
||||
|
||||
|
@ -43,7 +43,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=851780
|
|||
var textareaInput = 0;
|
||||
|
||||
// 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];
|
||||
|
||||
// Those are events were the input event does not apply.
|
||||
|
|
|
@ -29,7 +29,7 @@ var validTypes =
|
|||
["text", false],
|
||||
["password", false],
|
||||
["search", false],
|
||||
["telephone", false],
|
||||
["tel", false],
|
||||
["email", false],
|
||||
["url", false],
|
||||
["hidden", false],
|
||||
|
|
|
@ -28,7 +28,7 @@ function checkAvailability()
|
|||
["text", false],
|
||||
["password", false],
|
||||
["search", false],
|
||||
["telephone", false],
|
||||
["tel", false],
|
||||
["email", false],
|
||||
["url", false],
|
||||
["hidden", false],
|
||||
|
|
|
@ -207,6 +207,8 @@ MediaDecoderStateMachine::MediaDecoderStateMachine(MediaDecoder* aDecoder,
|
|||
mMinimizePreroll(false),
|
||||
mDecodeThreadWaiting(false),
|
||||
mRealTime(aRealTime),
|
||||
mDispatchedDecodeMetadataTask(false),
|
||||
mDispatchedDecodeSeekTask(false),
|
||||
mLastFrameStatus(MediaDecoderOwner::NEXT_FRAME_UNINITIALIZED),
|
||||
mTimerId(0)
|
||||
{
|
||||
|
@ -1486,12 +1488,18 @@ MediaDecoderStateMachine::EnqueueDecodeMetadataTask()
|
|||
{
|
||||
AssertCurrentThreadInMonitor();
|
||||
|
||||
if (mState != DECODER_STATE_DECODING_METADATA) {
|
||||
if (mState != DECODER_STATE_DECODING_METADATA ||
|
||||
mDispatchedDecodeMetadataTask) {
|
||||
return NS_OK;
|
||||
}
|
||||
nsresult rv = mDecodeTaskQueue->Dispatch(
|
||||
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;
|
||||
}
|
||||
|
@ -1595,14 +1603,18 @@ MediaDecoderStateMachine::EnqueueDecodeSeekTask()
|
|||
"Should be on state machine or decode thread.");
|
||||
AssertCurrentThreadInMonitor();
|
||||
|
||||
if (mState != DECODER_STATE_SEEKING) {
|
||||
if (mState != DECODER_STATE_SEEKING ||
|
||||
mDispatchedDecodeSeekTask) {
|
||||
return NS_OK;
|
||||
}
|
||||
nsresult rv = mDecodeTaskQueue->Dispatch(
|
||||
NS_NewRunnableMethod(this, &MediaDecoderStateMachine::DecodeSeek));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return NS_OK;
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
mDispatchedDecodeSeekTask = true;
|
||||
} else {
|
||||
NS_WARNING("Dispatch DecodeSeek task failed.");
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -1803,6 +1815,7 @@ void
|
|||
MediaDecoderStateMachine::CallDecodeMetadata()
|
||||
{
|
||||
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
|
||||
AutoSetOnScopeExit<bool> unsetOnExit(mDispatchedDecodeMetadataTask, false);
|
||||
if (mState != DECODER_STATE_DECODING_METADATA) {
|
||||
return;
|
||||
}
|
||||
|
@ -1918,6 +1931,7 @@ void MediaDecoderStateMachine::DecodeSeek()
|
|||
{
|
||||
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
|
||||
NS_ASSERTION(OnDecodeThread(), "Should be on decode thread.");
|
||||
AutoSetOnScopeExit<bool> unsetOnExit(mDispatchedDecodeSeekTask, false);
|
||||
if (mState != DECODER_STATE_SEEKING) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -932,6 +932,16 @@ protected:
|
|||
// True is we are decoding a realtime stream, like a camera stream
|
||||
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
|
||||
// must be held when accessing this.
|
||||
MediaInfo mInfo;
|
||||
|
|
|
@ -169,6 +169,23 @@ bool IsVideoContentType(const nsCString& aContentType);
|
|||
bool IsValidVideoRegion(const nsIntSize& aFrame, const nsIntRect& aPicture,
|
||||
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
|
||||
|
||||
#endif
|
||||
|
|
|
@ -298,41 +298,6 @@ BiquadFilterNode::WrapObject(JSContext* aCx)
|
|||
void
|
||||
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;
|
||||
SendInt32ParameterToStream(BiquadFilterNodeEngine::TYPE,
|
||||
static_cast<int32_t>(aType));
|
||||
|
|
|
@ -48,34 +48,6 @@ public:
|
|||
}
|
||||
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) {
|
||||
// ::Custom can only be set by setPeriodicWave().
|
||||
// https://github.com/WebAudio/web-audio-api/issues/105 for exception.
|
||||
|
@ -96,15 +68,7 @@ public:
|
|||
}
|
||||
|
||||
void Start(double aWhen, ErrorResult& aRv);
|
||||
void NoteOn(double aWhen, ErrorResult& aRv)
|
||||
{
|
||||
Start(aWhen, aRv);
|
||||
}
|
||||
void Stop(double aWhen, ErrorResult& aRv);
|
||||
void NoteOff(double aWhen, ErrorResult& aRv)
|
||||
{
|
||||
Stop(aWhen, aRv);
|
||||
}
|
||||
void SetPeriodicWave(PeriodicWave& aPeriodicWave)
|
||||
{
|
||||
mPeriodicWave = &aPeriodicWave;
|
||||
|
|
|
@ -60,29 +60,6 @@ public:
|
|||
}
|
||||
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;
|
||||
SendInt32ParameterToStream(PANNING_MODEL, int32_t(mPanningModel));
|
||||
}
|
||||
|
@ -93,31 +70,6 @@ public:
|
|||
}
|
||||
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;
|
||||
SendInt32ParameterToStream(DISTANCE_MODEL, int32_t(mDistanceModel));
|
||||
}
|
||||
|
|
|
@ -55,8 +55,6 @@ addLoadEvent(function() {
|
|||
"allpass",
|
||||
];
|
||||
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];
|
||||
}
|
||||
|
||||
|
|
|
@ -23,9 +23,6 @@ addLoadEvent(function() {
|
|||
expectException(function() {
|
||||
osc.type = "custom";
|
||||
}, 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.frequency.value, 440, "Correct default frequency value");
|
||||
is(osc.detune.value, 0, "Correct default detine value");
|
||||
|
@ -38,8 +35,6 @@ addLoadEvent(function() {
|
|||
"triangle",
|
||||
];
|
||||
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];
|
||||
}
|
||||
|
||||
|
|
|
@ -45,17 +45,6 @@ addLoadEvent(function() {
|
|||
is(panner.channelCountMode, "clamped-max", "Correct channelCountMode 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.setOrientation(1, 1, 1);
|
||||
panner.setVelocity(1, 1, 1);
|
||||
|
|
|
@ -5580,6 +5580,8 @@ class CGCallGenerator(CGThing):
|
|||
self.cgRoot.append(CGIndenter(errorReport))
|
||||
self.cgRoot.append(CGGeneric("}\n"))
|
||||
|
||||
self.cgRoot.append(CGGeneric("MOZ_ASSERT(!JS_IsExceptionPending(cx));\n"))
|
||||
|
||||
def define(self):
|
||||
return self.cgRoot.define()
|
||||
|
||||
|
|
|
@ -3,10 +3,13 @@
|
|||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
DIST_FILES = \
|
||||
bootstrap.js \
|
||||
install.rdf \
|
||||
$(NULL)
|
||||
|
||||
DIST_FILES_NO_PP = \
|
||||
bootstrap.js \
|
||||
$(NULL)
|
||||
|
||||
TEST_EXTENSIONS_DIR = $(DEPTH)/_tests/testing/mochitest/extensions
|
||||
|
||||
GENERATED_DIRS = $(TEST_EXTENSIONS_DIR)
|
||||
|
|
|
@ -11,9 +11,6 @@
|
|||
*/
|
||||
|
||||
enum BiquadFilterType {
|
||||
// Hack: Use numbers to support alternate enum values
|
||||
"0", "1", "2", "3", "4", "5", "6", "7",
|
||||
|
||||
"lowpass",
|
||||
"highpass",
|
||||
"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 {
|
||||
// Hack: Use numbers to support alternate enum values
|
||||
"0", "1", "2", "3", "4",
|
||||
|
||||
"sine",
|
||||
"square",
|
||||
"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 {
|
||||
// Hack: Use numbers to support alternate enum values
|
||||
"0", "1",
|
||||
|
||||
"equalpower",
|
||||
"HRTF"
|
||||
};
|
||||
|
||||
enum DistanceModelType {
|
||||
// Hack: Use numbers to support alternate enum values
|
||||
"0", "1", "2",
|
||||
|
||||
"linear",
|
||||
"inverse",
|
||||
"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/.
|
||||
|
||||
DIST_FILES = \
|
||||
bootstrap.js \
|
||||
install.rdf \
|
||||
$(NULL)
|
||||
|
||||
DIST_FILES_NO_PP = \
|
||||
bootstrap.js \
|
||||
worker.js \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
|
||||
DIST_FILES = \
|
||||
install.rdf \
|
||||
$(NULL)
|
||||
|
||||
DIST_FILES_NO_PP = \
|
||||
worker.js \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
// access the dictionary resources.
|
||||
|
||||
#include "hnjalloc.h"
|
||||
#undef FILE // Undo the damage done in hnjalloc.h
|
||||
#include "nsNetUtil.h"
|
||||
|
||||
#define BUFSIZE 1024
|
||||
|
|
|
@ -5,12 +5,13 @@
|
|||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
UNIFIED_SOURCES += [
|
||||
'hnjstdio.cpp',
|
||||
'nsHyphenationManager.cpp',
|
||||
'nsHyphenator.cpp',
|
||||
]
|
||||
|
||||
# These files cannot be built in unified mode because they include hnjalloc.h.
|
||||
SOURCES += [
|
||||
'hnjstdio.cpp',
|
||||
'hyphen.c',
|
||||
]
|
||||
|
||||
|
|
|
@ -41,10 +41,10 @@ const size_t CellSize = size_t(1) << CellShift;
|
|||
const size_t CellMask = CellSize - 1;
|
||||
|
||||
/* 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 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
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "jspubtd.h"
|
||||
|
||||
#include "js/HeapAPI.h"
|
||||
#include "js/TypeDecls.h"
|
||||
#include "js/Utility.h"
|
||||
|
||||
|
@ -665,7 +666,9 @@ struct GCMethods<JSObject *>
|
|||
static JSObject *initial() { return nullptr; }
|
||||
static ThingRootKind kind() { return RootKind<JSObject *>::rootKind(); }
|
||||
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
|
||||
static void postBarrier(JSObject **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 ThingRootKind kind() { return THING_ROOT_VALUE; }
|
||||
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
|
||||
static void postBarrier(JS::Value *v) { JS::HeapValuePostBarrier(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;
|
||||
}
|
||||
|
||||
void
|
||||
HeapSlot::preconditionForWriteBarrierPost(JSObject *obj, Kind kind, uint32_t slot, Value target)
|
||||
bool
|
||||
HeapSlot::preconditionForWriteBarrierPost(JSObject *obj, Kind kind, uint32_t slot, Value target) const
|
||||
{
|
||||
JS_ASSERT_IF(kind == Slot, obj->getSlotAddressUnchecked(slot)->get() == target);
|
||||
JS_ASSERT_IF(kind == Element,
|
||||
static_cast<HeapSlot *>(obj->getDenseElements() + slot)->get() == target);
|
||||
return kind == Slot
|
||||
? obj->getSlotAddressUnchecked(slot)->get() == target
|
||||
: static_cast<HeapSlot *>(obj->getDenseElements() + slot)->get() == target;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -233,9 +233,9 @@ class BarrieredCell : public gc::Cell
|
|||
#endif
|
||||
}
|
||||
|
||||
static void writeBarrierPost(T *thing, void *addr) {}
|
||||
static void writeBarrierPostRelocate(T *thing, void *addr) {}
|
||||
static void writeBarrierPostRemove(T *thing, void *addr) {}
|
||||
static void writeBarrierPost(T *thing, void *cellp) {}
|
||||
static void writeBarrierPostRelocate(T *thing, void *cellp) {}
|
||||
static void writeBarrierPostRemove(T *thing, void *cellp) {}
|
||||
};
|
||||
|
||||
} // namespace gc
|
||||
|
@ -243,30 +243,12 @@ class BarrieredCell : public gc::Cell
|
|||
// Note: the following Zone-getting functions must be equivalent to the zone()
|
||||
// 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 *
|
||||
ShadowZoneOfString(JSString *str)
|
||||
{
|
||||
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 *
|
||||
ZoneOfObjectFromAnyThread(const JSObject &obj);
|
||||
|
||||
|
@ -339,6 +321,7 @@ struct InternalGCMethods<Value>
|
|||
preBarrier(ZoneOfValueFromAnyThread(v), v);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void preBarrier(Zone *zone, Value v) {
|
||||
#ifdef JSGC_INCREMENTAL
|
||||
if (v.isString() && StringIsPermanentAtom(v.toString()))
|
||||
|
@ -352,24 +335,34 @@ struct InternalGCMethods<Value>
|
|||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void postBarrier(Value *vp) {
|
||||
#ifdef JSGC_GENERATIONAL
|
||||
if (vp->isObject())
|
||||
shadowRuntimeFromAnyThread(*vp)->gcStoreBufferPtr()->putValue(vp);
|
||||
if (vp->isObject()) {
|
||||
gc::StoreBuffer *sb = reinterpret_cast<gc::Cell *>(&vp->toObject())->storeBuffer();
|
||||
if (sb)
|
||||
sb->putValueFromAnyThread(vp);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void postBarrierRelocate(Value *vp) {
|
||||
#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
|
||||
}
|
||||
|
||||
static void postBarrierRemove(Value *vp) {
|
||||
#ifdef JSGC_GENERATIONAL
|
||||
JS_ASSERT(vp);
|
||||
JS_ASSERT(vp->isMarkable());
|
||||
JSRuntime *rt = static_cast<js::gc::Cell *>(vp->toGCThing())->runtimeFromAnyThread();
|
||||
JS::shadow::Runtime *shadowRuntime = JS::shadow::Runtime::asShadowRuntime(rt);
|
||||
shadowRuntime->gcStoreBufferPtr()->removeRelocatableValue(vp);
|
||||
shadowRuntime->gcStoreBufferPtr()->removeRelocatableValueFromAnyThread(vp);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -608,7 +601,7 @@ class RelocatablePtr : public BarrieredBase<T>
|
|||
public:
|
||||
RelocatablePtr() : BarrieredBase<T>(GCMethods<T>::initial()) {}
|
||||
explicit RelocatablePtr(T v) : BarrieredBase<T>(v) {
|
||||
if (isMarkable(v))
|
||||
if (GCMethods<T>::needsPostBarrier(v))
|
||||
post();
|
||||
}
|
||||
|
||||
|
@ -619,22 +612,22 @@ class RelocatablePtr : public BarrieredBase<T>
|
|||
* simply omit the rvalue variant.
|
||||
*/
|
||||
RelocatablePtr(const RelocatablePtr<T> &v) : BarrieredBase<T>(v) {
|
||||
if (isMarkable(this->value))
|
||||
if (GCMethods<T>::needsPostBarrier(this->value))
|
||||
post();
|
||||
}
|
||||
|
||||
~RelocatablePtr() {
|
||||
if (isMarkable(this->value))
|
||||
if (GCMethods<T>::needsPostBarrier(this->value))
|
||||
relocate();
|
||||
}
|
||||
|
||||
RelocatablePtr<T> &operator=(T v) {
|
||||
this->pre();
|
||||
JS_ASSERT(!GCMethods<T>::poisoned(v));
|
||||
if (isMarkable(v)) {
|
||||
if (GCMethods<T>::needsPostBarrier(v)) {
|
||||
this->value = v;
|
||||
post();
|
||||
} else if (isMarkable(this->value)) {
|
||||
} else if (GCMethods<T>::needsPostBarrier(this->value)) {
|
||||
relocate();
|
||||
this->value = v;
|
||||
} else {
|
||||
|
@ -646,10 +639,10 @@ class RelocatablePtr : public BarrieredBase<T>
|
|||
RelocatablePtr<T> &operator=(const RelocatablePtr<T> &v) {
|
||||
this->pre();
|
||||
JS_ASSERT(!GCMethods<T>::poisoned(v.value));
|
||||
if (isMarkable(v.value)) {
|
||||
if (GCMethods<T>::needsPostBarrier(v.value)) {
|
||||
this->value = v.value;
|
||||
post();
|
||||
} else if (isMarkable(this->value)) {
|
||||
} else if (GCMethods<T>::needsPostBarrier(this->value)) {
|
||||
relocate();
|
||||
this->value = v;
|
||||
} else {
|
||||
|
@ -660,20 +653,16 @@ class RelocatablePtr : public BarrieredBase<T>
|
|||
}
|
||||
|
||||
protected:
|
||||
static bool isMarkable(const T &v) {
|
||||
return InternalGCMethods<T>::isMarkable(v);
|
||||
}
|
||||
|
||||
void post() {
|
||||
#ifdef JSGC_GENERATIONAL
|
||||
JS_ASSERT(isMarkable(this->value));
|
||||
JS_ASSERT(GCMethods<T>::needsPostBarrier(this->value));
|
||||
InternalGCMethods<T>::postBarrierRelocate(&this->value);
|
||||
#endif
|
||||
}
|
||||
|
||||
void relocate() {
|
||||
#ifdef JSGC_GENERATIONAL
|
||||
JS_ASSERT(isMarkable(this->value));
|
||||
JS_ASSERT(GCMethods<T>::needsPostBarrier(this->value));
|
||||
InternalGCMethods<T>::postBarrierRemove(&this->value);
|
||||
#endif
|
||||
}
|
||||
|
@ -864,64 +853,43 @@ class HeapSlot : public BarrieredBase<Value>
|
|||
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
|
||||
bool preconditionForSet(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,
|
||||
Value target);
|
||||
bool preconditionForWriteBarrierPost(JSObject *obj, Kind kind, uint32_t slot, Value target) const;
|
||||
#endif
|
||||
|
||||
void set(JSObject *owner, Kind kind, uint32_t slot, const Value &v) {
|
||||
JS_ASSERT(preconditionForSet(owner, kind, slot));
|
||||
pre();
|
||||
JS_ASSERT(!IsPoisonedValue(v));
|
||||
pre();
|
||||
value = v;
|
||||
post(owner, kind, slot, v);
|
||||
}
|
||||
|
||||
void set(Zone *zone, JSObject *owner, Kind kind, uint32_t slot, const Value &v) {
|
||||
JS_ASSERT(preconditionForSet(zone, owner, kind, slot));
|
||||
JS::shadow::Zone *shadowZone = JS::shadow::Zone::asShadowZone(zone);
|
||||
pre(zone);
|
||||
JS_ASSERT(!IsPoisonedValue(v));
|
||||
pre(zone);
|
||||
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)
|
||||
{
|
||||
#ifdef JSGC_GENERATIONAL
|
||||
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
|
||||
/* For users who need to manually barrier the raw types. */
|
||||
static void writeBarrierPost(JSObject *owner, Kind kind, uint32_t slot, const Value &target) {
|
||||
reinterpret_cast<HeapSlot *>(const_cast<Value *>(&target))->post(owner, kind, slot, target);
|
||||
}
|
||||
|
||||
private:
|
||||
void post(JSObject *owner, Kind kind, uint32_t slot, Value target) {
|
||||
HeapSlot::writeBarrierPost(owner, kind, slot, target);
|
||||
}
|
||||
|
||||
void post(JSRuntime *rt, JSObject *owner, Kind kind, uint32_t slot, Value target) {
|
||||
HeapSlot::writeBarrierPost(rt, owner, kind, slot, target);
|
||||
void post(JSObject *owner, Kind kind, uint32_t slot, const Value &target) {
|
||||
JS_ASSERT(preconditionForWriteBarrierPost(owner, kind, slot, target));
|
||||
#ifdef JSGC_GENERATIONAL
|
||||
if (this->value.isObject()) {
|
||||
gc::Cell *cell = reinterpret_cast<gc::Cell *>(&this->value.toObject());
|
||||
if (cell->storeBuffer())
|
||||
cell->storeBuffer()->putSlotFromAnyThread(owner, kind, slot, 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -111,6 +111,8 @@ struct Cell
|
|||
inline JSRuntime *runtimeFromAnyThread() const;
|
||||
inline JS::shadow::Runtime *shadowRuntimeFromAnyThread() const;
|
||||
|
||||
inline StoreBuffer *storeBuffer() const;
|
||||
|
||||
#ifdef DEBUG
|
||||
inline bool isAligned() const;
|
||||
inline bool isTenured() const;
|
||||
|
@ -608,15 +610,16 @@ struct ChunkTrailer
|
|||
{
|
||||
/* The index the chunk in the nursery, or LocationTenuredHeap. */
|
||||
uint32_t location;
|
||||
|
||||
#if JS_BITS_PER_WORD == 64
|
||||
uint32_t padding;
|
||||
#endif
|
||||
|
||||
/* The store buffer for writes to things in this chunk or nullptr. */
|
||||
StoreBuffer *storeBuffer;
|
||||
|
||||
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). */
|
||||
struct ChunkInfo
|
||||
|
@ -865,9 +868,13 @@ static_assert(sizeof(Chunk) == ChunkSize,
|
|||
static_assert(js::gc::ChunkMarkBitmapOffset == offsetof(Chunk, bitmap),
|
||||
"The hardcoded API bitmap offset must match the actual offset.");
|
||||
static_assert(js::gc::ChunkRuntimeOffset == offsetof(Chunk, info) +
|
||||
offsetof(ChunkInfo, trailer) +
|
||||
offsetof(ChunkTrailer, runtime),
|
||||
offsetof(ChunkInfo, trailer) +
|
||||
offsetof(ChunkTrailer, runtime),
|
||||
"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
|
||||
ArenaHeader::address() const
|
||||
|
@ -1097,6 +1104,12 @@ Cell::chunk() const
|
|||
return reinterpret_cast<Chunk *>(addr);
|
||||
}
|
||||
|
||||
inline StoreBuffer *
|
||||
Cell::storeBuffer() const
|
||||
{
|
||||
return chunk()->info.trailer.storeBuffer;
|
||||
}
|
||||
|
||||
inline bool
|
||||
InFreeList(ArenaHeader *aheader, void *thing)
|
||||
{
|
||||
|
|
|
@ -203,6 +203,7 @@ class Nursery
|
|||
|
||||
MOZ_ALWAYS_INLINE void initChunk(int chunkno) {
|
||||
NurseryChunkLayout &c = chunk(chunkno);
|
||||
c.trailer.storeBuffer = JS::shadow::Runtime::asShadowRuntime(runtime())->gcStoreBufferPtr();
|
||||
c.trailer.location = gc::ChunkLocationNursery;
|
||||
c.trailer.runtime = runtime();
|
||||
}
|
||||
|
|
|
@ -335,39 +335,45 @@ StoreBuffer::addSizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf, JS::GCSi
|
|||
JS_PUBLIC_API(void)
|
||||
JS::HeapCellPostBarrier(js::gc::Cell **cellp)
|
||||
{
|
||||
JS_ASSERT(cellp);
|
||||
JS_ASSERT(*cellp);
|
||||
JSRuntime *runtime = (*cellp)->runtimeFromMainThread();
|
||||
runtime->gc.storeBuffer.putRelocatableCell(cellp);
|
||||
StoreBuffer *storeBuffer = (*cellp)->storeBuffer();
|
||||
if (storeBuffer)
|
||||
storeBuffer->putRelocatableCellFromAnyThread(cellp);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(void)
|
||||
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);
|
||||
JSRuntime *runtime = (*cellp)->runtimeFromMainThread();
|
||||
runtime->gc.storeBuffer.removeRelocatableCell(cellp);
|
||||
runtime->gc.storeBuffer.removeRelocatableCellFromAnyThread(cellp);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(void)
|
||||
JS::HeapValuePostBarrier(JS::Value *valuep)
|
||||
{
|
||||
JS_ASSERT(valuep);
|
||||
JS_ASSERT(valuep->isMarkable());
|
||||
if (valuep->isString() && StringIsPermanentAtom(valuep->toString()))
|
||||
return;
|
||||
JSRuntime *runtime = static_cast<js::gc::Cell *>(valuep->toGCThing())->runtimeFromMainThread();
|
||||
runtime->gc.storeBuffer.putRelocatableValue(valuep);
|
||||
if (valuep->isObject()) {
|
||||
StoreBuffer *storeBuffer = valuep->toObject().storeBuffer();
|
||||
if (storeBuffer)
|
||||
storeBuffer->putRelocatableValueFromAnyThread(valuep);
|
||||
}
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(void)
|
||||
JS::HeapValueRelocate(JS::Value *valuep)
|
||||
{
|
||||
/* Called with old contents of *valuep before overwriting. */
|
||||
JS_ASSERT(valuep);
|
||||
JS_ASSERT(valuep->isMarkable());
|
||||
if (valuep->isString() && StringIsPermanentAtom(valuep->toString()))
|
||||
if (valuep->isString() && valuep->toString()->isPermanentAtom())
|
||||
return;
|
||||
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>;
|
||||
|
|
|
@ -244,7 +244,8 @@ class StoreBuffer
|
|||
bool operator!=(const CellPtrEdge &other) const { return edge != other.edge; }
|
||||
|
||||
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);
|
||||
|
@ -267,7 +268,8 @@ class StoreBuffer
|
|||
void *deref() const { return edge->isGCThing() ? edge->toGCThing() : nullptr; }
|
||||
|
||||
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);
|
||||
|
@ -362,8 +364,7 @@ class StoreBuffer
|
|||
void *data;
|
||||
};
|
||||
|
||||
template <typename Edge>
|
||||
bool isOkayToUseBuffer(const Edge &edge) const {
|
||||
bool isOkayToUseBuffer() const {
|
||||
/*
|
||||
* Disabled store buffers may not have a valid state; e.g. when stored
|
||||
* inline in the ChunkTrailer.
|
||||
|
@ -382,8 +383,8 @@ class StoreBuffer
|
|||
}
|
||||
|
||||
template <typename Buffer, typename Edge>
|
||||
void put(Buffer &buffer, const Edge &edge) {
|
||||
if (!isOkayToUseBuffer(edge))
|
||||
void putFromAnyThread(Buffer &buffer, const Edge &edge) {
|
||||
if (!isOkayToUseBuffer())
|
||||
return;
|
||||
mozilla::ReentrancyGuard g(*this);
|
||||
if (edge.maybeInRememberedSet(nursery_))
|
||||
|
@ -391,8 +392,8 @@ class StoreBuffer
|
|||
}
|
||||
|
||||
template <typename Buffer, typename Edge>
|
||||
void unput(Buffer &buffer, const Edge &edge) {
|
||||
if (!isOkayToUseBuffer(edge))
|
||||
void unputFromAnyThread(Buffer &buffer, const Edge &edge) {
|
||||
if (!isOkayToUseBuffer())
|
||||
return;
|
||||
mozilla::ReentrancyGuard g(*this);
|
||||
buffer.unput(this, edge);
|
||||
|
@ -432,30 +433,38 @@ class StoreBuffer
|
|||
bool isAboutToOverflow() const { return aboutToOverflow_; }
|
||||
|
||||
/* Insert a single edge into the buffer/remembered set. */
|
||||
void putValue(JS::Value *valuep) { put(bufferVal, ValueEdge(valuep)); }
|
||||
void putCell(Cell **cellp) { put(bufferCell, CellPtrEdge(cellp)); }
|
||||
void putSlot(JSObject *obj, int kind, int32_t start, int32_t count) {
|
||||
put(bufferSlot, SlotsEdge(obj, kind, start, count));
|
||||
void putValueFromAnyThread(JS::Value *valuep) { putFromAnyThread(bufferVal, ValueEdge(valuep)); }
|
||||
void putCellFromAnyThread(Cell **cellp) { putFromAnyThread(bufferCell, CellPtrEdge(cellp)); }
|
||||
void putSlotFromAnyThread(JSObject *obj, int kind, int32_t start, int32_t count) {
|
||||
putFromAnyThread(bufferSlot, SlotsEdge(obj, kind, start, count));
|
||||
}
|
||||
void putWholeCell(Cell *cell) {
|
||||
JS_ASSERT(cell->isTenured());
|
||||
put(bufferWholeCell, WholeCellEdges(cell));
|
||||
putFromAnyThread(bufferWholeCell, WholeCellEdges(cell));
|
||||
}
|
||||
|
||||
/* Insert or update a single edge in the Relocatable buffer. */
|
||||
void putRelocatableValue(JS::Value *valuep) { put(bufferRelocVal, ValueEdge(valuep)); }
|
||||
void putRelocatableCell(Cell **cellp) { put(bufferRelocCell, CellPtrEdge(cellp)); }
|
||||
void removeRelocatableValue(JS::Value *valuep) { unput(bufferRelocVal, ValueEdge(valuep)); }
|
||||
void removeRelocatableCell(Cell **cellp) { unput(bufferRelocCell, CellPtrEdge(cellp)); }
|
||||
void putRelocatableValueFromAnyThread(JS::Value *valuep) {
|
||||
putFromAnyThread(bufferRelocVal, ValueEdge(valuep));
|
||||
}
|
||||
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. */
|
||||
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. */
|
||||
template <typename Key>
|
||||
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. */
|
||||
|
|
|
@ -247,12 +247,6 @@ Zone::createJitZone(JSContext *cx)
|
|||
}
|
||||
#endif
|
||||
|
||||
JS::Zone *
|
||||
js::ZoneOfObject(const JSObject &obj)
|
||||
{
|
||||
return obj.zone();
|
||||
}
|
||||
|
||||
JS::Zone *
|
||||
js::ZoneOfObjectFromAnyThread(const JSObject &obj)
|
||||
{
|
||||
|
@ -268,3 +262,12 @@ Zone::hasMarkedCompartments()
|
|||
}
|
||||
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;
|
||||
|
||||
/* Return the Zone* of a Value. Asserts if the Value is not a GC thing. */
|
||||
Zone *
|
||||
ZoneOfValue(const JS::Value &value);
|
||||
|
||||
} /* namespace js */
|
||||
|
||||
#endif /* gc_Zone_h */
|
||||
|
|
|
@ -789,6 +789,7 @@ Chunk::init(JSRuntime *rt)
|
|||
|
||||
/* Initialize the chunk info. */
|
||||
info.age = 0;
|
||||
info.trailer.storeBuffer = nullptr;
|
||||
info.trailer.location = ChunkLocationTenuredHeap;
|
||||
info.trailer.runtime = rt;
|
||||
|
||||
|
|
|
@ -2293,8 +2293,8 @@ JSObject::TradeGuts(JSContext *cx, JSObject *a, JSObject *b, TradeGutsReserved &
|
|||
* below, in common with the other case.
|
||||
*/
|
||||
for (size_t i = 0; i < a->numFixedSlots(); ++i) {
|
||||
HeapSlot::writeBarrierPost(cx->runtime(), a, HeapSlot::Slot, i, a->getSlot(i));
|
||||
HeapSlot::writeBarrierPost(cx->runtime(), b, HeapSlot::Slot, i, b->getSlot(i));
|
||||
HeapSlot::writeBarrierPost(a, HeapSlot::Slot, i, a->getSlot(i));
|
||||
HeapSlot::writeBarrierPost(b, HeapSlot::Slot, i, b->getSlot(i));
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
|
|
|
@ -187,7 +187,7 @@ DenseRangeWriteBarrierPost(JSRuntime *rt, JSObject *obj, uint32_t start, uint32_
|
|||
#ifdef JSGC_GENERATIONAL
|
||||
if (count > 0) {
|
||||
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
|
||||
}
|
||||
|
|
|
@ -223,12 +223,13 @@ JSObject::ensureDenseInitializedLengthNoPackedCheck(js::ThreadSafeContext *cx, u
|
|||
uint32_t &initlen = getElementsHeader()->initializedLength;
|
||||
|
||||
if (initlen < index + extra) {
|
||||
JSRuntime *rt = runtimeFromAnyThread();
|
||||
size_t offset = initlen;
|
||||
for (js::HeapSlot *sp = elements + initlen;
|
||||
sp != elements + (index + extra);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -264,24 +264,22 @@ js::ObjectImpl::initializeSlotRange(uint32_t start, uint32_t length)
|
|||
HeapSlot *fixedStart, *fixedEnd, *slotsStart, *slotsEnd;
|
||||
getSlotRangeUnchecked(start, length, &fixedStart, &fixedEnd, &slotsStart, &slotsEnd);
|
||||
|
||||
JSRuntime *rt = runtimeFromAnyThread();
|
||||
uint32_t offset = start;
|
||||
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++)
|
||||
sp->init(rt, this->asObjectPtr(), HeapSlot::Slot, offset++, UndefinedValue());
|
||||
sp->init(this->asObjectPtr(), HeapSlot::Slot, offset++, UndefinedValue());
|
||||
}
|
||||
|
||||
void
|
||||
js::ObjectImpl::initSlotRange(uint32_t start, const Value *vector, uint32_t length)
|
||||
{
|
||||
JSRuntime *rt = runtimeFromAnyThread();
|
||||
HeapSlot *fixedStart, *fixedEnd, *slotsStart, *slotsEnd;
|
||||
getSlotRange(start, length, &fixedStart, &fixedEnd, &slotsStart, &slotsEnd);
|
||||
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++)
|
||||
sp->init(rt, this->asObjectPtr(), HeapSlot::Slot, start++, *vector++);
|
||||
sp->init(this->asObjectPtr(), HeapSlot::Slot, start++, *vector++);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -840,7 +840,12 @@ class ObjectImpl : public gc::BarrieredCell<ObjectImpl>
|
|||
|
||||
void privateWriteBarrierPost(void **pprivate) {
|
||||
#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
|
||||
}
|
||||
|
||||
|
@ -944,30 +949,43 @@ BarrieredCell<ObjectImpl>::isNullLike(ObjectImpl *obj)
|
|||
|
||||
template<>
|
||||
/* static */ inline void
|
||||
BarrieredCell<ObjectImpl>::writeBarrierPost(ObjectImpl *obj, void *addr)
|
||||
BarrieredCell<ObjectImpl>::writeBarrierPost(ObjectImpl *obj, void *cellp)
|
||||
{
|
||||
JS_ASSERT(cellp);
|
||||
#ifdef JSGC_GENERATIONAL
|
||||
if (IsNullTaggedPointer(obj))
|
||||
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
|
||||
}
|
||||
|
||||
template<>
|
||||
/* 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
|
||||
obj->shadowRuntimeFromAnyThread()->gcStoreBufferPtr()->putRelocatableCell((Cell **)addr);
|
||||
gc::StoreBuffer *storeBuffer = obj->storeBuffer();
|
||||
if (storeBuffer)
|
||||
storeBuffer->putRelocatableCellFromAnyThread(static_cast<Cell **>(cellp));
|
||||
#endif
|
||||
}
|
||||
|
||||
template<>
|
||||
/* 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
|
||||
obj->shadowRuntimeFromAnyThread()->gcStoreBufferPtr()->removeRelocatableCell((Cell **)addr);
|
||||
obj->shadowRuntimeFromAnyThread()->gcStoreBufferPtr()->removeRelocatableCellFromAnyThread(
|
||||
static_cast<Cell **>(cellp));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -525,8 +525,12 @@ static inline void
|
|||
GetterSetterWriteBarrierPost(JSRuntime *rt, JSObject **objp)
|
||||
{
|
||||
#ifdef JSGC_GENERATIONAL
|
||||
JS::shadow::Runtime *shadowRuntime = JS::shadow::Runtime::asShadowRuntime(rt);
|
||||
shadowRuntime->gcStoreBufferPtr()->putRelocatableCell(reinterpret_cast<gc::Cell **>(objp));
|
||||
JS_ASSERT(objp);
|
||||
JS_ASSERT(*objp);
|
||||
gc::Cell **cellp = reinterpret_cast<gc::Cell **>(objp);
|
||||
gc::StoreBuffer *storeBuffer = (*cellp)->storeBuffer();
|
||||
if (storeBuffer)
|
||||
storeBuffer->putRelocatableCellFromAnyThread(cellp);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -535,7 +539,7 @@ GetterSetterWriteBarrierPostRemove(JSRuntime *rt, JSObject **objp)
|
|||
{
|
||||
#ifdef JSGC_GENERATIONAL
|
||||
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
|
||||
}
|
||||
|
||||
|
|
|
@ -139,15 +139,15 @@ InterpreterFrame::writeBarrierPost()
|
|||
{
|
||||
/* This needs to follow the same rules as in InterpreterFrame::mark. */
|
||||
if (scopeChain_)
|
||||
JSObject::writeBarrierPost(scopeChain_, (void *)&scopeChain_);
|
||||
JSObject::writeBarrierPost(scopeChain_, &scopeChain_);
|
||||
if (flags_ & HAS_ARGS_OBJ)
|
||||
JSObject::writeBarrierPost(argsObj_, (void *)&argsObj_);
|
||||
JSObject::writeBarrierPost(argsObj_, &argsObj_);
|
||||
if (isFunctionFrame()) {
|
||||
JSFunction::writeBarrierPost(exec.fun, (void *)&exec.fun);
|
||||
JSFunction::writeBarrierPost(exec.fun, &exec.fun);
|
||||
if (isEvalFrame())
|
||||
JSScript::writeBarrierPost(u.evalScript, (void *)&u.evalScript);
|
||||
JSScript::writeBarrierPost(u.evalScript, &u.evalScript);
|
||||
} else {
|
||||
JSScript::writeBarrierPost(exec.script, (void *)&exec.script);
|
||||
JSScript::writeBarrierPost(exec.script, &exec.script);
|
||||
}
|
||||
if (hasReturnValue())
|
||||
HeapValue::writeBarrierPost(rval_, &rval_);
|
||||
|
|
|
@ -3,21 +3,16 @@
|
|||
# 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/.
|
||||
|
||||
JS_FILES = \
|
||||
componentdir = js/xpconnect/tests/components/js
|
||||
|
||||
JS_FILES := \
|
||||
xpctest_attributes.js \
|
||||
xpctest_bug809674.js \
|
||||
xpctest_interfaces.js \
|
||||
xpctest_params.js \
|
||||
xpctest.manifest \
|
||||
$(NULL)
|
||||
|
||||
MANIFEST_FILE = xpctest.manifest
|
||||
JS_DEST = $(testxpcobjdir)/$(componentdir)
|
||||
INSTALL_TARGETS += JS
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
#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();
|
||||
}
|
||||
|
||||
|
|
|
@ -1330,12 +1330,17 @@ void CreateAnswer(sipcc::MediaConstraints& constraints, std::string offer,
|
|||
|
||||
mozilla::RefPtr<mozilla::MediaPipeline> GetMediaPipeline(
|
||||
bool local, int stream, int track) {
|
||||
sipcc::SourceStreamInfo *streamInfo;
|
||||
|
||||
sipcc::SourceStreamInfo* streamInfo;
|
||||
if (local) {
|
||||
streamInfo = pc->media()->GetLocalStream(stream);
|
||||
mozilla::SyncRunnable::DispatchToThread(
|
||||
gMainThread, WrapRunnableRet(
|
||||
pc->media(), &sipcc::PeerConnectionMedia::GetLocalStream,
|
||||
stream, &streamInfo));
|
||||
} else {
|
||||
streamInfo = pc->media()->GetRemoteStream(stream);
|
||||
mozilla::SyncRunnable::DispatchToThread(
|
||||
gMainThread, WrapRunnableRet(
|
||||
pc->media(), &sipcc::PeerConnectionMedia::GetRemoteStream,
|
||||
stream, &streamInfo));
|
||||
}
|
||||
|
||||
if (!streamInfo) {
|
||||
|
|
|
@ -9,10 +9,17 @@
|
|||
#ifndef 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/Compiler.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/MacroArgs.h"
|
||||
#ifdef MOZ_DUMP_ASSERTION_STACK
|
||||
#include "nsTraceRefcnt.h"
|
||||
#endif
|
||||
|
||||
#include <stddef.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);
|
||||
#else
|
||||
fprintf(stderr, "Assertion failure: %s, at %s:%d\n", s, file, ln);
|
||||
#ifdef MOZ_DUMP_ASSERTION_STACK
|
||||
nsTraceRefcnt::WalkTheStack(stderr);
|
||||
#endif
|
||||
fflush(stderr);
|
||||
#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);
|
||||
#else
|
||||
fprintf(stderr, "Hit MOZ_CRASH(%s) at %s:%d\n", s, file, ln);
|
||||
#ifdef MOZ_DUMP_ASSERTION_STACK
|
||||
nsTraceRefcnt::WalkTheStack(stderr);
|
||||
#endif
|
||||
fflush(stderr);
|
||||
#endif
|
||||
}
|
||||
|
@ -484,4 +497,6 @@ void ValidateAssertConditionType()
|
|||
# define MOZ_ALWAYS_FALSE(expr) ((void)(expr))
|
||||
#endif
|
||||
|
||||
#undef MOZ_DUMP_ASSERTION_STACK
|
||||
|
||||
#endif /* mozilla_Assertions_h */
|
||||
|
|
|
@ -757,7 +757,7 @@ Http2Session::GenerateGoAway(uint32_t aStatusCode)
|
|||
|
||||
// last-good-stream-id are bytes 8-11 reflecting pushes
|
||||
uint32_t goAway = PR_htonl(mOutgoingGoAwayID);
|
||||
memcpy (packet + 7, &goAway, 4);
|
||||
memcpy(packet + 8, &goAway, 4);
|
||||
|
||||
// bytes 12-15 are the status code.
|
||||
aStatusCode = PR_htonl(aStatusCode);
|
||||
|
|
|
@ -161,10 +161,9 @@ static struct sock_filter seccomp_filter[] = {
|
|||
#endif
|
||||
ALLOW_SYSCALL(rt_sigprocmask),
|
||||
|
||||
/* System calls used by the profiler */
|
||||
#ifdef MOZ_PROFILING
|
||||
// Used by profiler. Also used for raise(), which causes problems
|
||||
// with Android KitKat abort(); see bug 1004832.
|
||||
ALLOW_SYSCALL(tgkill),
|
||||
#endif
|
||||
|
||||
/* B2G specific low-frequency syscalls */
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
|
|
|
@ -25,7 +25,9 @@ testing_modules := \
|
|||
utils.js \
|
||||
$(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_DEST = $(FINAL_TARGET)/modules/services-common
|
||||
|
|
|
@ -62,7 +62,9 @@ sync_testing_modules := \
|
|||
fxa_utils.js \
|
||||
$(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.
|
||||
SYNC_MAIN_FILES := $(addprefix modules/,$(sync_modules))
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
LIBS += $(MOZ_COMPONENT_LIBS)
|
||||
DIST_FILES += \
|
||||
DIST_FILES_NO_PP += \
|
||||
$(srcdir)/TestStartupCacheTelemetry.manifest \
|
||||
$(srcdir)/TestStartupCacheTelemetry.js \
|
||||
$(NULL)
|
||||
|
|
|
@ -144,11 +144,6 @@ user_pref("network.http.bypass-cachelock-threshold", 200000);
|
|||
user_pref("dom.gamepad.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
|
||||
// so we bypass the OSX dialog raised by the corelocation provider
|
||||
user_pref("geo.provider.testing", true);
|
||||
|
|
|
@ -8,6 +8,9 @@ NO_JS_MANIFEST = 1
|
|||
|
||||
DIST_FILES = \
|
||||
install.rdf \
|
||||
$(NULL)
|
||||
|
||||
DIST_FILES_NO_PP = \
|
||||
chrome.manifest \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
LIBRARY_NAME = 'xpt'
|
||||
|
||||
UNIFIED_SOURCES += [
|
||||
'xpt_arena.c',
|
||||
'xpt_struct.c',
|
||||
'xpt_xdr.c',
|
||||
'xpt_arena.cpp',
|
||||
'xpt_struct.cpp',
|
||||
'xpt_xdr.cpp',
|
||||
]
|
||||
|
||||
FINAL_LIBRARY = 'xpcom_core'
|
||||
|
|
|
@ -105,7 +105,7 @@ struct XPTArena
|
|||
XPT_PUBLIC_API(XPTArena *)
|
||||
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) {
|
||||
XPT_ASSERT(alignment);
|
||||
if (alignment > sizeof(double))
|
||||
|
@ -244,7 +244,7 @@ XPT_ArenaStrDup(XPTArena *arena, const char * s)
|
|||
return NULL;
|
||||
|
||||
len = strlen(s)+1;
|
||||
cur = XPT_ArenaMalloc(arena, len);
|
||||
cur = (char*)XPT_ArenaMalloc(arena, len);
|
||||
memcpy(cur, s, len);
|
||||
return cur;
|
||||
}
|
|
@ -98,8 +98,8 @@ XPT_NewHeader(XPTArena *arena, uint16_t num_interfaces, uint8_t major_version, u
|
|||
header->num_interfaces = num_interfaces;
|
||||
if (num_interfaces) {
|
||||
header->interface_directory =
|
||||
XPT_CALLOC(arena,
|
||||
num_interfaces * sizeof(XPTInterfaceDirectoryEntry));
|
||||
(XPTInterfaceDirectoryEntry*)XPT_CALLOC(arena,
|
||||
num_interfaces * sizeof(XPTInterfaceDirectoryEntry));
|
||||
if (!header->interface_directory) {
|
||||
XPT_DELETE(arena, header);
|
||||
return NULL;
|
||||
|
@ -207,7 +207,6 @@ XPT_DoHeaderPrologue(XPTArena *arena, XPTCursor *cursor, XPTHeader **headerp, ui
|
|||
XPT_PUBLIC_API(PRBool)
|
||||
XPT_DoHeader(XPTArena *arena, XPTCursor *cursor, XPTHeader **headerp)
|
||||
{
|
||||
const int HEADER_SIZE = 24;
|
||||
XPTMode mode = cursor->state->mode;
|
||||
XPTHeader * header;
|
||||
uint32_t ide_offset;
|
||||
|
@ -237,8 +236,8 @@ XPT_DoHeader(XPTArena *arena, XPTCursor *cursor, XPTHeader **headerp)
|
|||
|
||||
if (mode == XPT_DECODE && header->num_interfaces) {
|
||||
header->interface_directory =
|
||||
XPT_CALLOC(arena, header->num_interfaces *
|
||||
sizeof(XPTInterfaceDirectoryEntry));
|
||||
(XPTInterfaceDirectoryEntry*)XPT_CALLOC(arena, header->num_interfaces *
|
||||
sizeof(XPTInterfaceDirectoryEntry));
|
||||
if (!header->interface_directory)
|
||||
goto error;
|
||||
}
|
||||
|
@ -347,16 +346,16 @@ XPT_NewInterfaceDescriptor(XPTArena *arena,
|
|||
return NULL;
|
||||
|
||||
if (num_methods) {
|
||||
id->method_descriptors = XPT_CALLOC(arena, num_methods *
|
||||
sizeof(XPTMethodDescriptor));
|
||||
id->method_descriptors = (XPTMethodDescriptor*)XPT_CALLOC(arena, num_methods *
|
||||
sizeof(XPTMethodDescriptor));
|
||||
if (!id->method_descriptors)
|
||||
goto free_id;
|
||||
id->num_methods = num_methods;
|
||||
}
|
||||
|
||||
if (num_constants) {
|
||||
id->const_descriptors = XPT_CALLOC(arena, num_constants *
|
||||
sizeof(XPTConstDescriptor));
|
||||
id->const_descriptors = (XPTConstDescriptor*)XPT_CALLOC(arena, num_constants *
|
||||
sizeof(XPTConstDescriptor));
|
||||
if (!id->const_descriptors)
|
||||
goto free_meth;
|
||||
id->num_constants = num_constants;
|
||||
|
@ -415,20 +414,20 @@ XPT_InterfaceDescriptorAddTypes(XPTArena *arena, XPTInterfaceDescriptor *id,
|
|||
uint16_t num)
|
||||
{
|
||||
XPTTypeDescriptor *old = id->additional_types;
|
||||
XPTTypeDescriptor *new;
|
||||
XPTTypeDescriptor *new_;
|
||||
size_t old_size = id->num_additional_types * sizeof(XPTTypeDescriptor);
|
||||
size_t new_size = (num * sizeof(XPTTypeDescriptor)) + old_size;
|
||||
|
||||
/* XXX should grow in chunks to minimize alloc overhead */
|
||||
new = XPT_CALLOC(arena, new_size);
|
||||
if (!new)
|
||||
new_ = (XPTTypeDescriptor*)XPT_CALLOC(arena, new_size);
|
||||
if (!new_)
|
||||
return PR_FALSE;
|
||||
if (old) {
|
||||
if (old_size)
|
||||
memcpy(new, old, old_size);
|
||||
memcpy(new_, old, old_size);
|
||||
XPT_FREE(arena, old);
|
||||
}
|
||||
id->additional_types = new;
|
||||
id->additional_types = new_;
|
||||
id->num_additional_types += num;
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
@ -438,20 +437,20 @@ XPT_InterfaceDescriptorAddMethods(XPTArena *arena, XPTInterfaceDescriptor *id,
|
|||
uint16_t num)
|
||||
{
|
||||
XPTMethodDescriptor *old = id->method_descriptors;
|
||||
XPTMethodDescriptor *new;
|
||||
XPTMethodDescriptor *new_;
|
||||
size_t old_size = id->num_methods * sizeof(XPTMethodDescriptor);
|
||||
size_t new_size = (num * sizeof(XPTMethodDescriptor)) + old_size;
|
||||
|
||||
/* XXX should grow in chunks to minimize alloc overhead */
|
||||
new = XPT_CALLOC(arena, new_size);
|
||||
if (!new)
|
||||
new_ = (XPTMethodDescriptor*)XPT_CALLOC(arena, new_size);
|
||||
if (!new_)
|
||||
return PR_FALSE;
|
||||
if (old) {
|
||||
if (old_size)
|
||||
memcpy(new, old, old_size);
|
||||
memcpy(new_, old, old_size);
|
||||
XPT_FREE(arena, old);
|
||||
}
|
||||
id->method_descriptors = new;
|
||||
id->method_descriptors = new_;
|
||||
id->num_methods += num;
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
@ -461,20 +460,20 @@ XPT_InterfaceDescriptorAddConsts(XPTArena *arena, XPTInterfaceDescriptor *id,
|
|||
uint16_t num)
|
||||
{
|
||||
XPTConstDescriptor *old = id->const_descriptors;
|
||||
XPTConstDescriptor *new;
|
||||
XPTConstDescriptor *new_;
|
||||
size_t old_size = id->num_constants * sizeof(XPTConstDescriptor);
|
||||
size_t new_size = (num * sizeof(XPTConstDescriptor)) + old_size;
|
||||
|
||||
/* XXX should grow in chunks to minimize alloc overhead */
|
||||
new = XPT_CALLOC(arena, new_size);
|
||||
if (!new)
|
||||
new_ = (XPTConstDescriptor*)XPT_CALLOC(arena, new_size);
|
||||
if (!new_)
|
||||
return PR_FALSE;
|
||||
if (old) {
|
||||
if (old_size)
|
||||
memcpy(new, old, old_size);
|
||||
memcpy(new_, old, old_size);
|
||||
XPT_FREE(arena, old);
|
||||
}
|
||||
id->const_descriptors = new;
|
||||
id->const_descriptors = new_;
|
||||
id->num_constants += num;
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
@ -604,8 +603,8 @@ DoInterfaceDescriptor(XPTArena *arena, XPTCursor *outer,
|
|||
}
|
||||
|
||||
if (mode == XPT_DECODE && id->num_methods) {
|
||||
id->method_descriptors = XPT_CALLOC(arena, id->num_methods *
|
||||
sizeof(XPTMethodDescriptor));
|
||||
id->method_descriptors = (XPTMethodDescriptor*)XPT_CALLOC(arena, id->num_methods *
|
||||
sizeof(XPTMethodDescriptor));
|
||||
if (!id->method_descriptors)
|
||||
goto error;
|
||||
}
|
||||
|
@ -620,8 +619,8 @@ DoInterfaceDescriptor(XPTArena *arena, XPTCursor *outer,
|
|||
}
|
||||
|
||||
if (mode == XPT_DECODE && id->num_constants) {
|
||||
id->const_descriptors = XPT_CALLOC(arena, id->num_constants *
|
||||
sizeof(XPTConstDescriptor));
|
||||
id->const_descriptors = (XPTConstDescriptor*)XPT_CALLOC(arena, id->num_constants *
|
||||
sizeof(XPTConstDescriptor));
|
||||
if (!id->const_descriptors)
|
||||
goto error;
|
||||
}
|
||||
|
@ -704,7 +703,7 @@ XPT_FillMethodDescriptor(XPTArena *arena, XPTMethodDescriptor *meth,
|
|||
return PR_FALSE;
|
||||
meth->num_args = 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)
|
||||
goto free_name;
|
||||
} else {
|
||||
|
@ -712,7 +711,6 @@ XPT_FillMethodDescriptor(XPTArena *arena, XPTMethodDescriptor *meth,
|
|||
}
|
||||
return PR_TRUE;
|
||||
|
||||
free_params:
|
||||
XPT_DELETE(arena, meth->params);
|
||||
free_name:
|
||||
XPT_DELETE(arena, meth->name);
|
||||
|
@ -732,7 +730,7 @@ DoMethodDescriptor(XPTArena *arena, XPTCursor *cursor, XPTMethodDescriptor *md,
|
|||
return PR_FALSE;
|
||||
|
||||
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)
|
||||
return PR_FALSE;
|
||||
}
|
|
@ -167,7 +167,7 @@ XPT_NewXDRState(XPTMode mode, char *data, uint32_t len)
|
|||
state->pool->data = data;
|
||||
state->pool->allocated = len;
|
||||
} else {
|
||||
state->pool->data = XPT_MALLOC(arena, XPT_GROW_CHUNK);
|
||||
state->pool->data = (char*)XPT_MALLOC(arena, XPT_GROW_CHUNK);
|
||||
if (!state->pool->data)
|
||||
goto err_free_hash;
|
||||
state->pool->allocated = XPT_GROW_CHUNK;
|
||||
|
@ -249,7 +249,7 @@ GrowPool(XPTArena *arena, XPTDatapool *pool, uint32_t old_size,
|
|||
total_size = at_least;
|
||||
}
|
||||
|
||||
newdata = XPT_MALLOC(arena, total_size);
|
||||
newdata = (char*)XPT_MALLOC(arena, total_size);
|
||||
if (!newdata)
|
||||
return PR_FALSE;
|
||||
if (pool->data) {
|
||||
|
@ -312,7 +312,7 @@ XPT_NewString(XPTArena *arena, uint16_t length, char *bytes)
|
|||
return NULL;
|
||||
str->length = length;
|
||||
/* 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) {
|
||||
XPT_DELETE(arena, str);
|
||||
return NULL;
|
||||
|
@ -350,7 +350,7 @@ XPT_DoStringInline(XPTArena *arena, XPTCursor *cursor, XPTString **strp)
|
|||
goto error;
|
||||
|
||||
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;
|
||||
|
||||
for (i = 0; i < str->length; i++)
|
||||
|
@ -415,7 +415,7 @@ XPT_DoCString(XPTArena *arena, XPTCursor *cursor, char **identp)
|
|||
len = end - start;
|
||||
XPT_ASSERT(len > 0);
|
||||
|
||||
ident = XPT_MALLOC(arena, len + 1u);
|
||||
ident = (char*)XPT_MALLOC(arena, len + 1u);
|
||||
if (!ident)
|
||||
return PR_FALSE;
|
||||
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
LIBS = \
|
||||
$(DIST)/lib/$(LIB_PREFIX)xpt.$(LIB_SUFFIX) \
|
||||
$(XPCOM_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -38,7 +38,7 @@ struct TestData {
|
|||
output = {0, 0, {0, 0}, NULL, NULL };
|
||||
|
||||
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",
|
||||
label, str->bit32, str->bit16, str->bit8[0], str->bit8[1],
|
||||
|
@ -96,7 +96,7 @@ main(int argc, char **argv)
|
|||
(uint8_t)data[i]);
|
||||
fprintf(stderr, "\n");
|
||||
|
||||
whole = malloc(dlen + hlen);
|
||||
whole = (char*)malloc(dlen + hlen);
|
||||
if (!whole) {
|
||||
fprintf(stderr, "malloc %d failed!\n", dlen + hlen);
|
||||
return 1;
|
|
@ -10,5 +10,5 @@ SIMPLE_PROGRAMS = [
|
|||
]
|
||||
|
||||
SOURCES += [
|
||||
'%s.c' % s for s in SIMPLE_PROGRAMS
|
||||
'%s.cpp' % s for s in SIMPLE_PROGRAMS
|
||||
]
|
||||
|
|
Загрузка…
Ссылка в новой задаче