This commit is contained in:
Ryan VanderMeulen 2013-05-02 07:37:56 -04:00
Родитель 850535cee6 7516f47aa0
Коммит ca504dd560
246 изменённых файлов: 2226 добавлений и 2068 удалений

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

@ -12,6 +12,10 @@ let menuitems = [], menupopups = [], huds = [], tabs = [], runCount = 0;
function test()
{
if (runCount == 0) {
requestLongerTimeout(2);
}
// open tab 1
addTab("data:text/html;charset=utf-8,Web Console test for bug 602572: log bodies checkbox. tab 1");
tabs.push(tab);

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

@ -264,13 +264,13 @@ ChangeUI all "nsisui.exe"
!if "${AB_CD}" == "en-US"
; Custom strings for en-US. This is done here so they aren't translated.
!define INDENT " "
!define INTRO_BLURB "Thanks for choosing $BrandFullName. Were not just designed to be different, were different by design. Click to install."
!define INTRO_BLURB "Thanks for choosing $BrandFullName. Were not just designed to be different, were different by design."
!define INSTALL_BLURB1 "You're about to enjoy the very latest in speed, flexibility and security so you're always in control."
!define INSTALL_BLURB2 "And you're joining a global community of users, contributors and developers working to make the best browser in the world."
!define INSTALL_BLURB3 "You even get a haiku:$\n${INDENT}Proudly non-profit$\n${INDENT}Free to innovate for you$\n${INDENT}And a better Web"
!undef INDENT
!else
!define INTRO_BLURB "$(INTRO_BLURB)"
!define INTRO_BLURB "$(INTRO_BLURB1)"
!define INSTALL_BLURB1 "$(INSTALL_BLURB1)"
!define INSTALL_BLURB2 "$(INSTALL_BLURB2)"
!define INSTALL_BLURB3 "$(INSTALL_BLURB3)"
@ -698,7 +698,11 @@ Function createIntro
${NSD_SetStretchedImage} $2 $PLUGINSDIR\bgintro.bmp $1
GetDlgItem $0 $HWNDPARENT 1 ; Install button
SendMessage $0 ${WM_SETTEXT} 0 "STR:$(INSTALL_BUTTON)"
${If} ${FileExists} "$INSTDIR\${FileMainEXE}"
SendMessage $0 ${WM_SETTEXT} 0 "STR:$(UPGRADE_BUTTON)"
${Else}
SendMessage $0 ${WM_SETTEXT} 0 "STR:$(INSTALL_BUTTON)"
${EndIf}
${NSD_SetFocus} $0
GetDlgItem $0 $HWNDPARENT 2 ; Cancel button
@ -949,7 +953,11 @@ Function createOptions
!endif
GetDlgItem $0 $HWNDPARENT 1 ; Install button
SendMessage $0 ${WM_SETTEXT} 0 "STR:$(INSTALL_BUTTON)"
${If} ${FileExists} "$INSTDIR\${FileMainEXE}"
SendMessage $0 ${WM_SETTEXT} 0 "STR:$(UPGRADE_BUTTON)"
${Else}
SendMessage $0 ${WM_SETTEXT} 0 "STR:$(INSTALL_BUTTON)"
${EndIf}
${NSD_SetFocus} $0
GetDlgItem $0 $HWNDPARENT 2 ; Cancel button
@ -969,7 +977,7 @@ Function createOptions
${EndIf}
${EndIf}
IntOp $OptionsPageShownCount $OptionsPageShownCount + 1
StrCpy $OptionsPageShownCount "1"
System::Call "kernel32::GetTickCount()l .s"
Pop $StartOptionsPhaseTickCount
@ -1681,6 +1689,13 @@ Function OnChange_DirRequest
System::Call 'user32::GetWindowTextW(i $DirRequest, w .r0, i ${NSIS_MAX_STRLEN})'
StrCpy $INSTDIR "$0"
Call UpdateFreeSpaceLabel
GetDlgItem $0 $HWNDPARENT 1 ; Install button
${If} ${FileExists} "$INSTDIR\${FileMainEXE}"
SendMessage $0 ${WM_SETTEXT} 0 "STR:$(UPGRADE_BUTTON)"
${Else}
SendMessage $0 ${WM_SETTEXT} 0 "STR:$(INSTALL_BUTTON)"
${EndIf}
FunctionEnd
Function OnClick_ButtonBrowse

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

@ -20,7 +20,7 @@
WIN_CAPTION=$BrandShortName Setup
INTRO_BLURB=Thanks for choosing $BrandFullName, the browser that chooses you above everything else. Click to install.
INTRO_BLURB1=Thanks for choosing $BrandFullName, the browser that chooses you above everything else.
INSTALL_BLURB1=You're about to enjoy the very latest in speed, flexibility and security so you're always in control.
INSTALL_BLURB2=That's because $BrandShortName is made by a non-profit to make browsing and the Web better for you.
INSTALL_BLURB3=You're also joining a global community of users, contributors and developers working to make the best browser in the world.

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

@ -307,9 +307,3 @@
fun:_ZN7mozilla3dom7workers13WorkerPrivate9DoRunLoopEP9JSContext
...
}
{
Bug 866959
Memcheck:Cond
fun:_ZN16imgStatusTracker27CalculateAndApplyDifferenceEPS_
...
}

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

@ -2166,7 +2166,7 @@ ia64*-hpux*)
XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE -NXCOMPAT"
LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE -NXCOMPAT -RELEASE"
dnl For profile-guided optimization
PROFILE_GEN_CFLAGS="-GL"
PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
@ -3537,34 +3537,6 @@ if test "$GNU_CC"; then
TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc3}"
fi
dnl Check for support of modern template specialization syntax
dnl Test code and requirement from scc@netscape.com.
dnl Autoconf cut-and-paste job by waterson@netscape.com
AC_CACHE_CHECK(for modern C++ template specialization syntax support,
ac_cv_cpp_modern_specialize_template_syntax,
[AC_TRY_COMPILE(template <class T> struct X { int a; };
class Y {};
template <> struct X<Y> { double a; };,
X<int> int_x;
X<Y> y_x;,
ac_cv_cpp_modern_specialize_template_syntax=yes,
ac_cv_cpp_modern_specialize_template_syntax=no)])
if test "$ac_cv_cpp_modern_specialize_template_syntax" = no ; then
AC_MSG_ERROR([The C++ compiler does not support template specialization])
fi
dnl Some compilers support only full specialization, and some don't.
AC_CACHE_CHECK(whether partial template specialization works,
ac_cv_cpp_partial_specialization,
[AC_TRY_COMPILE(template <class T> class Foo {};
template <class T> class Foo<T*> {};,
return 0;,
ac_cv_cpp_partial_specialization=yes,
ac_cv_cpp_partial_specialization=no)])
if test "$ac_cv_cpp_partial_specialization" = yes ; then
AC_DEFINE(HAVE_CPP_PARTIAL_SPECIALIZATION)
fi
dnl Check to see if we can resolve ambiguity with |using|.
AC_CACHE_CHECK(whether the C++ \"using\" keyword resolves ambiguity,
ac_cv_cpp_ambiguity_resolving_using,

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

@ -972,8 +972,6 @@ struct NormalizeNewlinesCharTraits {
OutputIterator mIterator;
};
#ifdef HAVE_CPP_PARTIAL_SPECIALIZATION
template <class CharT>
struct NormalizeNewlinesCharTraits<CharT*> {
public:
@ -989,40 +987,6 @@ struct NormalizeNewlinesCharTraits<CharT*> {
CharT* mCharPtr;
};
#else
template <>
struct NormalizeNewlinesCharTraits<char*> {
public:
typedef char value_type;
public:
NormalizeNewlinesCharTraits(char* aCharPtr) : mCharPtr(aCharPtr) { }
void writechar(char aChar) {
*mCharPtr++ = aChar;
}
private:
char* mCharPtr;
};
template <>
struct NormalizeNewlinesCharTraits<PRUnichar*> {
public:
typedef PRUnichar value_type;
public:
NormalizeNewlinesCharTraits(PRUnichar* aCharPtr) : mCharPtr(aCharPtr) { }
void writechar(PRUnichar aChar) {
*mCharPtr++ = aChar;
}
private:
PRUnichar* mCharPtr;
};
#endif
template <class OutputIterator>
class CopyNormalizeNewlines
{

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

@ -1 +1,3 @@
conformance/more/conformance/quickCheckAPI-B2.html
conformance/more/conformance/quickCheckAPI-B2.html
conformance/more/conformance/quickCheckAPI-B3.html
conformance/more/functions/bufferSubDataBadArgs.html

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

@ -490,8 +490,12 @@ nsIMEStateManager::SetIMEState(const IMEState &aState,
} else {
context.mHTMLInputType.Assign(nsGkAtoms::textarea->GetUTF16String());
}
aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::inputmode,
context.mHTMLInputInputmode);
if (Preferences::GetBool("dom.forms.inputmode", false)) {
aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::inputmode,
context.mHTMLInputInputmode);
}
aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::moz_action_hint,
context.mActionHint);

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

@ -110,6 +110,7 @@ reflectUnsignedInt({
// .indeterminate doesn't reflect a content attribute.
// .inputmode
if (SpecialPowers.getBoolPref("dom.forms.inputmode")) {
reflectLimitedEnumerated({
element: document.createElement("input"),
attribute: "inputMode",
@ -117,6 +118,7 @@ reflectLimitedEnumerated({
invalidValues: [ "", "foo", "tulip" ],
defaultValue: "auto"
});
}
// TODO: list (HTMLElement)

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

@ -24,11 +24,6 @@ public:
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
virtual bool SupportsMediaStreams() const MOZ_OVERRIDE
{
return true;
}
void GetFloatFrequencyData(Float32Array& aArray);
void GetByteFrequencyData(Uint8Array& aArray);
void GetByteTimeDomainData(Uint8Array& aArray);

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

@ -29,10 +29,6 @@ public:
}
AudioNode::DestroyMediaStream();
}
virtual bool SupportsMediaStreams() const MOZ_OVERRIDE
{
return true;
}
virtual uint32_t NumberOfInputs() const MOZ_FINAL MOZ_OVERRIDE
{
return 0;

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

@ -146,7 +146,7 @@ AudioNode::Connect(AudioNode& aDestination, uint32_t aOutput,
input->mInputNode = this;
input->mInputPort = aInput;
input->mOutputPort = aOutput;
if (SupportsMediaStreams() && aDestination.mStream) {
if (aDestination.mStream) {
// Connect streams in the MediaStreamGraph
MOZ_ASSERT(aDestination.mStream->AsProcessedStream());
ProcessedMediaStream* ps =

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

@ -87,13 +87,6 @@ public:
// This should be idempotent (safe to call multiple times).
virtual void DestroyMediaStream();
// This method should be overridden to return true in nodes
// which support being hooked up to the Media Stream graph.
virtual bool SupportsMediaStreams() const
{
return false;
}
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(AudioNode,
nsDOMEventTargetHelper)

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

@ -27,11 +27,6 @@ public:
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
virtual bool SupportsMediaStreams() const MOZ_OVERRIDE
{
return true;
}
BiquadFilterType Type() const
{
return mType;

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

@ -31,11 +31,6 @@ public:
return mDelay;
}
virtual bool SupportsMediaStreams() const MOZ_OVERRIDE
{
return true;
}
private:
static void SendDelayToStream(AudioNode* aNode);
friend class DelayNodeEngine;

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

@ -26,11 +26,6 @@ public:
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
virtual bool SupportsMediaStreams() const MOZ_OVERRIDE
{
return true;
}
AudioParam* Threshold() const
{
return mThreshold;

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

@ -31,11 +31,6 @@ public:
return mGain;
}
virtual bool SupportsMediaStreams() const MOZ_OVERRIDE
{
return true;
}
private:
static void SendGainToStream(AudioNode* aNode);

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

@ -33,11 +33,6 @@ public:
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
virtual bool SupportsMediaStreams() const MOZ_OVERRIDE
{
return true;
}
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(PannerNode, AudioNode)

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

@ -37,11 +37,6 @@ public:
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
virtual bool SupportsMediaStreams() const MOZ_OVERRIDE
{
return true;
}
virtual void Connect(AudioNode& aDestination, uint32_t aOutput,
uint32_t aInput, ErrorResult& aRv) MOZ_OVERRIDE
{

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

@ -34,17 +34,31 @@ XPCOMUtils.defineLazyGetter(this, "powerManagerService", function() {
let myGlobal = this;
/**
* AlarmService provides an API to schedule alarms using the device's RTC.
*
* AlarmService is primarily used by the mozAlarms API (navigator.mozAlarms)
* which uses IPC to communicate with the service.
*
* AlarmService can also be used by Gecko code by importing the module and then
* using AlarmService.add() and AlarmService.remove(). Only Gecko code running
* in the parent process should do this.
*/
this.AlarmService = {
init: function init() {
debug("init()");
this._currentTimezoneOffset = (new Date()).getTimezoneOffset();
let alarmHalService = this._alarmHalService = Cc["@mozilla.org/alarmHalService;1"].getService(Ci.nsIAlarmHalService);
let alarmHalService =
this._alarmHalService = Cc["@mozilla.org/alarmHalService;1"]
.getService(Ci.nsIAlarmHalService);
alarmHalService.setAlarmFiredCb(this._onAlarmFired.bind(this));
alarmHalService.setTimezoneChangedCb(this._onTimezoneChanged.bind(this));
// add the messages to be listened
// Add the messages to be listened to.
const messages = ["AlarmsManager:GetAll",
"AlarmsManager:Add",
"AlarmsManager:Remove"];
@ -52,19 +66,20 @@ this.AlarmService = {
ppmm.addMessageListener(msgName, this);
}.bind(this));
// set the indexeddb database
let idbManager = Cc["@mozilla.org/dom/indexeddb/manager;1"].getService(Ci.nsIIndexedDatabaseManager);
// Set the indexeddb database.
let idbManager = Cc["@mozilla.org/dom/indexeddb/manager;1"]
.getService(Ci.nsIIndexedDatabaseManager);
idbManager.initWindowless(myGlobal);
this._db = new AlarmDB(myGlobal);
this._db.init(myGlobal);
// variable to save alarms waiting to be set
// Variable to save alarms waiting to be set.
this._alarmQueue = [];
this._restoreAlarmsFromDb();
},
// getter/setter to access the current alarm set in system
// Getter/setter to access the current alarm set in system.
_alarm: null,
get _currentAlarm() {
return this._alarm;
@ -102,7 +117,8 @@ this.AlarmService = {
this._db.getAll(
json.manifestURL,
function getAllSuccessCb(aAlarms) {
debug("Callback after getting alarms from database: " + JSON.stringify(aAlarms));
debug("Callback after getting alarms from database: " +
JSON.stringify(aAlarms));
this._sendAsyncMessage(mm, "GetAll", true, json.requestId, aAlarms);
}.bind(this),
function getAllErrorCb(aErrorMsg) {
@ -112,105 +128,25 @@ this.AlarmService = {
break;
case "AlarmsManager:Add":
// prepare a record for the new alarm to be added
// Prepare a record for the new alarm to be added.
let newAlarm = {
date: json.date,
ignoreTimezone: json.ignoreTimezone,
timezoneOffset: this._currentTimezoneOffset,
date: json.date,
ignoreTimezone: json.ignoreTimezone,
data: json.data,
pageURL: json.pageURL,
manifestURL: json.manifestURL
};
let newAlarmTime = this._getAlarmTime(newAlarm);
if (newAlarmTime <= Date.now()) {
debug("Adding a alarm that has past time. Return DOMError.");
this._debugCurrentAlarm();
this._sendAsyncMessage(mm, "Add", false, json.requestId, "InvalidStateError");
break;
}
this._db.add(
newAlarm,
function addSuccessCb(aNewId) {
debug("Callback after adding alarm in database.");
newAlarm['id'] = aNewId;
// if there is no alarm being set in system, set the new alarm
if (this._currentAlarm == null) {
this._currentAlarm = newAlarm;
this._debugCurrentAlarm();
this._sendAsyncMessage(mm, "Add", true, json.requestId, aNewId);
return;
}
// if the new alarm is earlier than the current alarm
// swap them and push the previous alarm back to queue
let alarmQueue = this._alarmQueue;
let currentAlarmTime = this._getAlarmTime(this._currentAlarm);
if (newAlarmTime < currentAlarmTime) {
alarmQueue.unshift(this._currentAlarm);
this._currentAlarm = newAlarm;
this._debugCurrentAlarm();
this._sendAsyncMessage(mm, "Add", true, json.requestId, aNewId);
return;
}
//push the new alarm in the queue
alarmQueue.push(newAlarm);
alarmQueue.sort(this._sortAlarmByTimeStamps.bind(this));
this._debugCurrentAlarm();
this._sendAsyncMessage(mm, "Add", true, json.requestId, aNewId);
}.bind(this),
function addErrorCb(aErrorMsg) {
this._sendAsyncMessage(mm, "Add", false, json.requestId, aErrorMsg);
}.bind(this)
this.add(newAlarm, null,
// Receives the alarm ID as the last argument.
this._sendAsyncMessage.bind(this, mm, "Add", true, json.requestId),
// Receives the error message as the last argument.
this._sendAsyncMessage.bind(this, mm, "Add", false, json.requestId)
);
break;
case "AlarmsManager:Remove":
this._removeAlarmFromDb(
json.id,
json.manifestURL,
function removeSuccessCb() {
debug("Callback after removing alarm from database.");
// if there is no alarm being set
if (!this._currentAlarm) {
this._debugCurrentAlarm();
return;
}
// check if the alarm to be removed is in the queue
// by ID and whether it belongs to the requesting app
let alarmQueue = this._alarmQueue;
if (this._currentAlarm.id != json.id ||
this._currentAlarm.manifestURL != json.manifestURL) {
for (let i = 0; i < alarmQueue.length; i++) {
if (alarmQueue[i].id == json.id &&
alarmQueue[i].manifestURL == json.manifestURL) {
alarmQueue.splice(i, 1);
break;
}
}
this._debugCurrentAlarm();
return;
}
// the alarm to be removed is the current alarm
// reset the next alarm from queue if any
if (alarmQueue.length) {
this._currentAlarm = alarmQueue.shift();
this._debugCurrentAlarm();
return;
}
// no alarm waiting to be set in the queue
this._currentAlarm = null;
this._debugCurrentAlarm();
}.bind(this)
);
this.remove(json.id, json.manifestURL);
break;
default:
@ -219,7 +155,8 @@ this.AlarmService = {
}
},
_sendAsyncMessage: function _sendAsyncMessage(aMessageManager, aMessageName, aSuccess, aRequestId, aData) {
_sendAsyncMessage: function _sendAsyncMessage(aMessageManager, aMessageName,
aSuccess, aRequestId, aData) {
debug("_sendAsyncMessage()");
if (!aMessageManager) {
@ -231,14 +168,14 @@ this.AlarmService = {
switch (aMessageName)
{
case "Add":
json = aSuccess ?
{ requestId: aRequestId, id: aData } :
json = aSuccess ?
{ requestId: aRequestId, id: aData } :
{ requestId: aRequestId, errorMsg: aData };
break;
case "GetAll":
json = aSuccess ?
{ requestId: aRequestId, alarms: aData } :
json = aSuccess ?
{ requestId: aRequestId, alarms: aData } :
{ requestId: aRequestId, errorMsg: aData };
break;
@ -247,14 +184,16 @@ this.AlarmService = {
break;
}
aMessageManager.sendAsyncMessage("AlarmsManager:" + aMessageName + ":Return:" + (aSuccess ? "OK" : "KO"), json);
aMessageManager.sendAsyncMessage("AlarmsManager:" + aMessageName +
":Return:" + (aSuccess ? "OK" : "KO"), json);
},
_removeAlarmFromDb: function _removeAlarmFromDb(aId, aManifestURL, aRemoveSuccessCb) {
_removeAlarmFromDb: function _removeAlarmFromDb(aId, aManifestURL,
aRemoveSuccessCb) {
debug("_removeAlarmFromDb()");
// If the aRemoveSuccessCb is undefined or null, set a
// dummy callback for it which is needed for _db.remove()
// If the aRemoveSuccessCb is undefined or null, set a dummy callback for
// it which is needed for _db.remove().
if (!aRemoveSuccessCb) {
aRemoveSuccessCb = function removeSuccessCb() {
debug("Remove alarm from DB successfully.");
@ -271,28 +210,49 @@ this.AlarmService = {
);
},
/**
* Create a copy of the alarm that does not expose internal fields to
* receivers and sticks to the public |respectTimezone| API rather than the
* boolean |ignoreTimezone| field.
*/
_publicAlarm: function _publicAlarm(aAlarm) {
let alarm = {
"id": aAlarm.id,
"date": aAlarm.date,
"respectTimezone": aAlarm.ignoreTimezone ?
"ignoreTimezone" : "honorTimezone",
"data": aAlarm.data
};
return alarm;
},
_fireSystemMessage: function _fireSystemMessage(aAlarm) {
debug("Fire system message: " + JSON.stringify(aAlarm));
let manifestURI = Services.io.newURI(aAlarm.manifestURL, null, null);
let pageURI = Services.io.newURI(aAlarm.pageURL, null, null);
// We don't need to expose everything to the web content.
let alarm = { "id": aAlarm.id,
"date": aAlarm.date,
"respectTimezone": aAlarm.ignoreTimezone ?
"ignoreTimezone" : "honorTimezone",
"data": aAlarm.data };
messenger.sendMessage("alarm", this._publicAlarm(aAlarm),
pageURI, manifestURI);
},
messenger.sendMessage("alarm", alarm, pageURI, manifestURI);
_notifyAlarmObserver: function _notifyAlarmObserver(aAlarm) {
debug("_notifyAlarmObserver()");
if (aAlarm.manifestURL) {
this._fireSystemMessage(aAlarm);
} else if (typeof aAlarm.alarmFiredCb === "function") {
aAlarm.alarmFiredCb(this._publicAlarm(aAlarm));
}
},
_onAlarmFired: function _onAlarmFired() {
debug("_onAlarmFired()");
if (this._currentAlarm) {
this._fireSystemMessage(this._currentAlarm);
this._removeAlarmFromDb(this._currentAlarm.id, null);
this._notifyAlarmObserver(this._currentAlarm);
this._currentAlarm = null;
}
@ -302,11 +262,11 @@ this.AlarmService = {
let nextAlarm = alarmQueue.shift();
let nextAlarmTime = this._getAlarmTime(nextAlarm);
// If the next alarm has been expired, directly
// fire system message for it instead of setting it.
// If the next alarm has been expired, directly notify the observer.
// it instead of setting it.
if (nextAlarmTime <= Date.now()) {
this._fireSystemMessage(nextAlarm);
this._removeAlarmFromDb(nextAlarm.id, null);
this._notifyAlarmObserver(nextAlarm);
} else {
this._currentAlarm = nextAlarm;
break;
@ -328,25 +288,26 @@ this.AlarmService = {
this._db.getAll(
null,
function getAllSuccessCb(aAlarms) {
debug("Callback after getting alarms from database: " + JSON.stringify(aAlarms));
debug("Callback after getting alarms from database: " +
JSON.stringify(aAlarms));
// clear any alarms set or queued in the cache
// Clear any alarms set or queued in the cache.
let alarmQueue = this._alarmQueue;
alarmQueue.length = 0;
this._currentAlarm = null;
// Only restore the alarm that's not yet expired; otherwise,
// fire a system message for it and remove it from database.
// Only restore the alarm that's not yet expired; otherwise, remove it
// from the database and notify the observer.
aAlarms.forEach(function addAlarm(aAlarm) {
if (this._getAlarmTime(aAlarm) > Date.now()) {
alarmQueue.push(aAlarm);
} else {
this._fireSystemMessage(aAlarm);
this._removeAlarmFromDb(aAlarm.id, null);
this._notifyAlarmObserver(aAlarm);
}
}.bind(this));
// set the next alarm from queue
// Set the next alarm from queue.
if (alarmQueue.length) {
alarmQueue.sort(this._sortAlarmByTimeStamps.bind(this));
this._currentAlarm = alarmQueue.shift();
@ -363,14 +324,11 @@ this.AlarmService = {
_getAlarmTime: function _getAlarmTime(aAlarm) {
let alarmTime = (new Date(aAlarm.date)).getTime();
// For an alarm specified with "ignoreTimezone",
// it must be fired respect to the user's timezone.
// Supposing an alarm was set at 7:00pm at Tokyo,
// it must be gone off at 7:00pm respect to Paris'
// local time when the user is located at Paris.
// We can adjust the alarm UTC time by calculating
// the difference of the orginal timezone and the
// current timezone.
// For an alarm specified with "ignoreTimezone", it must be fired respect
// to the user's timezone. Supposing an alarm was set at 7:00pm at Tokyo,
// it must be gone off at 7:00pm respect to Paris' local time when the user
// is located at Paris. We can adjust the alarm UTC time by calculating
// the difference of the orginal timezone and the current timezone.
if (aAlarm.ignoreTimezone)
alarmTime += (this._currentTimezoneOffset - aAlarm.timezoneOffset) * 60000;
@ -385,6 +343,154 @@ this.AlarmService = {
debug("Current alarm: " + JSON.stringify(this._currentAlarm));
debug("Alarm queue: " + JSON.stringify(this._alarmQueue));
},
/**
*
* Add a new alarm. This will set the RTC to fire at the selected date and
* notify the caller. Notifications are delivered via System Messages if the
* alarm is added on behalf of a app. Otherwise aAlarmFiredCb is called.
*
* @param object aNewAlarm
* Should contain the following literal properties:
* - |date| date: when the alarm should timeout.
* - |ignoreTimezone| boolean: See [1] for the details.
* - |manifestURL| string: Manifest of app on whose behalf the alarm
* is added.
* - |pageURL| string: The page in the app that receives the system
* message.
* - |data| object [optional]: Data that can be stored in DB.
* @param function aAlarmFiredCb
* Callback function invoked when the alarm is fired.
* It receives a single argument, the alarm object.
* May be null.
* @param function aSuccessCb
* Callback function to receive an alarm ID (number).
* @param function aErrorCb
* Callback function to receive an error message (string).
* @returns void
*
* Notes:
* [1] https://wiki.mozilla.org/WebAPI/AlarmAPI#Proposed_API
*/
add: function(aNewAlarm, aAlarmFiredCb, aSuccessCb, aErrorCb) {
debug("add(" + aNewAlarm.date + ")");
aSuccessCb = aSuccessCb || function() {};
aErrorCb = aErrorCb || function() {};
if (!aNewAlarm) {
aErrorCb("alarm is null");
return;
}
aNewAlarm['timezoneOffset'] = this._currentTimezoneOffset;
let aNewAlarmTime = this._getAlarmTime(aNewAlarm);
if (aNewAlarmTime <= Date.now()) {
debug("Adding a alarm that has past time.");
this._debugCurrentAlarm();
aErrorCb("InvalidStateError");
return;
}
this._db.add(
aNewAlarm,
function addSuccessCb(aNewId) {
debug("Callback after adding alarm in database.");
aNewAlarm['id'] = aNewId;
// Now that the alarm has been added to the database, we can tack on
// the non-serializable callback to the in-memory object.
aNewAlarm['alarmFiredCb'] = aAlarmFiredCb;
// If there is no alarm being set in system, set the new alarm.
if (this._currentAlarm == null) {
this._currentAlarm = aNewAlarm;
this._debugCurrentAlarm();
aSuccessCb(aNewId);
return;
}
// If the new alarm is earlier than the current alarm, swap them and
// push the previous alarm back to queue.
let alarmQueue = this._alarmQueue;
let currentAlarmTime = this._getAlarmTime(this._currentAlarm);
if (aNewAlarmTime < currentAlarmTime) {
alarmQueue.unshift(this._currentAlarm);
this._currentAlarm = aNewAlarm;
this._debugCurrentAlarm();
aSuccessCb(aNewId);
return;
}
// Push the new alarm in the queue.
alarmQueue.push(aNewAlarm);
alarmQueue.sort(this._sortAlarmByTimeStamps.bind(this));
this._debugCurrentAlarm();
aSuccessCb(aNewId);
}.bind(this),
function addErrorCb(aErrorMsg) {
aErrorCb(aErrorMsg);
}.bind(this)
);
},
/*
* Remove the alarm associated with an ID.
*
* @param number aAlarmId
* The ID of the alarm to be removed.
* @param string aManifestURL
* Manifest URL for application which added the alarm. (Optional)
* @returns void
*/
remove: function(aAlarmId, aManifestURL) {
debug("remove(" + aAlarmId + ", " + aManifestURL + ")");
this._removeAlarmFromDb(
aAlarmId,
aManifestURL,
function removeSuccessCb() {
debug("Callback after removing alarm from database.");
// If there are no alarms set, nothing to do.
if (!this._currentAlarm) {
debug("No alarms set.");
return;
}
// Check if the alarm to be removed is in the queue and whether it
// belongs to the requesting app.
let alarmQueue = this._alarmQueue;
if (this._currentAlarm.id != aAlarmId ||
this._currentAlarm.manifestURL != aManifestURL) {
for (let i = 0; i < alarmQueue.length; i++) {
if (alarmQueue[i].id == aAlarmId &&
alarmQueue[i].manifestURL == aManifestURL) {
alarmQueue.splice(i, 1);
break;
}
}
this._debugCurrentAlarm();
return;
}
// The alarm to be removed is the current alarm reset the next alarm
// from queue if any.
if (alarmQueue.length) {
this._currentAlarm = alarmQueue.shift();
this._debugCurrentAlarm();
return;
}
// No alarm waiting to be set in the queue.
this._currentAlarm = null;
this._debugCurrentAlarm();
}.bind(this)
);
}
}
AlarmService.init();

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

@ -7728,6 +7728,8 @@ class CGBindingRoot(CGThing):
descriptors = config.getDescriptors(webIDLFile=webIDLFile,
hasInterfaceOrInterfacePrototypeObject=True,
skipGen=False)
hasWorkerStuff = len(config.getDescriptors(webIDLFile=webIDLFile,
workers=True)) != 0
mainDictionaries = config.getDictionaries(webIDLFile=webIDLFile,
workers=False)
workerDictionaries = config.getDictionaries(webIDLFile=webIDLFile,
@ -7839,13 +7841,12 @@ class CGBindingRoot(CGThing):
'XPCWrapper.h',
'nsDOMQS.h',
'AccessCheck.h',
'WorkerPrivate.h',
'nsContentUtils.h',
'mozilla/Preferences.h',
# Have to include nsDOMQS.h to get fast arg unwrapping
# for old-binding things with castability.
'nsDOMQS.h'
],
] + (['WorkerPrivate.h'] if hasWorkerStuff else []),
curr,
config,
jsImplemented)

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

@ -15,7 +15,6 @@
#include "nsIXPCScriptable.h"
#include <algorithm>
#include "jsdbgapi.h"
#include "mozilla/dom/ContentParent.h"
#include "mozilla/dom/ContentChild.h"
#include "mozilla/dom/IDBFactoryBinding.h"
@ -225,7 +224,7 @@ IDBFactory::Create(ContentParent* aContentParent,
// The CreateSandbox call returns a proxy to the actual sandbox object. We
// don't need a proxy here.
global = JS_UnwrapObject(global);
global = js::UncheckedUnwrap(global);
JSAutoCompartment ac(cx, global);

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

@ -86,6 +86,7 @@ nsDOMOfflineResourceList::nsDOMOfflineResourceList(nsIURI *aManifestURI,
, mManifestURI(aManifestURI)
, mDocumentURI(aDocumentURI)
, mExposeCacheUpdateStatus(true)
, mDontSetDocumentCache(false)
, mStatus(nsIDOMOfflineResourceList::IDLE)
, mCachedKeys(nullptr)
, mCachedKeysCount(0)
@ -449,6 +450,10 @@ nsDOMOfflineResourceList::Update()
window, getter_AddRefs(update));
NS_ENSURE_SUCCESS(rv, rv);
// Since we are invoking the cache update, cache on the document must not
// be updated until swapCache() method is called on applicationCache object.
mDontSetDocumentCache = true;
return NS_OK;
}
@ -620,6 +625,15 @@ NS_IMETHODIMP
nsDOMOfflineResourceList::ApplicationCacheAvailable(nsIApplicationCache *aApplicationCache)
{
mAvailableApplicationCache = aApplicationCache;
if (!mDontSetDocumentCache) {
nsCOMPtr<nsIApplicationCacheContainer> appCacheContainer =
GetDocumentAppCacheContainer();
if (appCacheContainer)
appCacheContainer->SetApplicationCache(aApplicationCache);
}
return NS_OK;
}
@ -718,6 +732,7 @@ nsDOMOfflineResourceList::UpdateCompleted(nsIOfflineCacheUpdate *aUpdate)
mCacheUpdate->RemoveObserver(this);
mCacheUpdate = nullptr;
mDontSetDocumentCache = false;
if (NS_SUCCEEDED(rv) && succeeded && !partial) {
if (isUpgrade) {

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

@ -79,6 +79,7 @@ private:
nsCOMPtr<nsIApplicationCache> mAvailableApplicationCache;
nsCOMPtr<nsIOfflineCacheUpdate> mCacheUpdate;
bool mExposeCacheUpdateStatus;
bool mDontSetDocumentCache;
uint16_t mStatus;
// The set of dynamic keys for this application cache object.

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

@ -47,7 +47,7 @@ interface HTMLInputElement : HTMLElement {
attribute unsigned long height;
[Pure]
attribute boolean indeterminate;
[Pure, SetterThrows]
[Pure, SetterThrows, Pref="dom.forms.inputmode"]
attribute DOMString inputMode;
[Pure]
readonly attribute HTMLElement? list;

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

@ -344,22 +344,28 @@ AsyncCompositionManager::ApplyAsyncContentTransformToTree(TimeStamp aCurrentFram
LayerComposite* layerComposite = aLayer->AsLayerComposite();
ViewTransform treeTransform;
gfxPoint scrollOffset;
gfx::Point scrollOffset;
*aWantNextFrame |=
controller->SampleContentTransformForFrame(aCurrentFrame,
container,
&treeTransform,
&scrollOffset);
scrollOffset);
const gfx3DMatrix& rootTransform = mLayerManager->GetRoot()->GetTransform();
const FrameMetrics& metrics = container->GetFrameMetrics();
gfx::Rect displayPortLayersPixels(metrics.mCriticalDisplayPort.IsEmpty() ?
metrics.mDisplayPort : metrics.mCriticalDisplayPort);
gfx::Margin fixedLayerMargins(0, 0, 0, 0);
float offsetX = 0, offsetY = 0;
SyncFrameMetrics(aLayer, treeTransform, scrollOffset, fixedLayerMargins,
offsetX, offsetY, mIsFirstPaint, mLayersUpdated);
gfx::Point offset(0, 0);
SyncFrameMetrics(scrollOffset, treeTransform.mScale.width, metrics.mScrollableRect,
mLayersUpdated, displayPortLayersPixels, 1 / rootTransform.GetXScale(),
mIsFirstPaint, fixedLayerMargins, offset);
mIsFirstPaint = false;
mLayersUpdated = false;
// Apply the render offset
mLayerManager->GetCompositor()->SetScreenRenderOffset(gfx::Point(offsetX, offsetY));
mLayerManager->GetCompositor()->SetScreenRenderOffset(offset);
gfx3DMatrix transform(gfx3DMatrix(treeTransform) * aLayer->GetTransform());
// The transform already takes the resolution scale into account. Since we
@ -398,11 +404,6 @@ AsyncCompositionManager::TransformScrollableLayer(Layer* aLayer, const gfx3DMatr
gfx3DMatrix treeTransform;
// Translate fixed position layers so that they stay in the correct position
// when mScrollOffset and metricsScrollOffset differ.
gfxPoint offset;
gfxSize scaleDiff;
float rootScaleX = aRootTransform.GetXScale(),
rootScaleY = aRootTransform.GetYScale();
// The ratio of layers pixels to device pixels. The Java
@ -443,14 +444,14 @@ AsyncCompositionManager::TransformScrollableLayer(Layer* aLayer, const gfx3DMatr
displayPortDevPixels.y += scrollOffsetDevPixels.y;
gfx::Margin fixedLayerMargins(0, 0, 0, 0);
float offsetX = 0, offsetY = 0;
gfx::Point offset(0, 0);
SyncViewportInfo(displayPortDevPixels, 1/rootScaleX, mLayersUpdated,
mScrollOffset, mXScale, mYScale, fixedLayerMargins,
offsetX, offsetY);
offset);
mLayersUpdated = false;
// Apply the render offset
mLayerManager->GetCompositor()->SetScreenRenderOffset(gfx::Point(offsetX, offsetY));
mLayerManager->GetCompositor()->SetScreenRenderOffset(offset);
// Handle transformations for asynchronous panning and zooming. We determine the
// zoom used by Gecko from the transformation set on the root layer, and we
@ -472,24 +473,29 @@ AsyncCompositionManager::TransformScrollableLayer(Layer* aLayer, const gfx3DMatr
treeTransform = gfx3DMatrix(ViewTransform(-scrollCompensation,
gfxSize(mXScale, mYScale)));
// Translate fixed position layers so that they stay in the correct position
// when mScrollOffset and metricsScrollOffset differ.
gfxPoint fixedOffset;
gfxSize scaleDiff;
// If the contents can fit entirely within the widget area on a particular
// dimenson, we need to translate and scale so that the fixed layers remain
// within the page boundaries.
if (mContentRect.width * tempScaleDiffX < metrics.mCompositionBounds.width) {
offset.x = -metricsScrollOffset.x;
fixedOffset.x = -metricsScrollOffset.x;
scaleDiff.width = std::min(1.0f, metrics.mCompositionBounds.width / (float)mContentRect.width);
} else {
offset.x = clamped(mScrollOffset.x / tempScaleDiffX, (float)mContentRect.x,
fixedOffset.x = clamped(mScrollOffset.x / tempScaleDiffX, (float)mContentRect.x,
mContentRect.XMost() - metrics.mCompositionBounds.width / tempScaleDiffX) -
metricsScrollOffset.x;
scaleDiff.width = tempScaleDiffX;
}
if (mContentRect.height * tempScaleDiffY < metrics.mCompositionBounds.height) {
offset.y = -metricsScrollOffset.y;
fixedOffset.y = -metricsScrollOffset.y;
scaleDiff.height = std::min(1.0f, metrics.mCompositionBounds.height / (float)mContentRect.height);
} else {
offset.y = clamped(mScrollOffset.y / tempScaleDiffY, (float)mContentRect.y,
fixedOffset.y = clamped(mScrollOffset.y / tempScaleDiffY, (float)mContentRect.y,
mContentRect.YMost() - metrics.mCompositionBounds.height / tempScaleDiffY) -
metricsScrollOffset.y;
scaleDiff.height = tempScaleDiffY;
@ -506,7 +512,7 @@ AsyncCompositionManager::TransformScrollableLayer(Layer* aLayer, const gfx3DMatr
1.0f/container->GetPostYScale(),
1);
layerComposite->SetShadowTransform(computedTransform);
TransformFixedLayers(aLayer, offset, scaleDiff, fixedLayerMargins);
TransformFixedLayers(aLayer, fixedOffset, scaleDiff, fixedLayerMargins);
}
bool
@ -576,7 +582,7 @@ AsyncCompositionManager::SyncViewportInfo(const nsIntRect& aDisplayPort,
nsIntPoint& aScrollOffset,
float& aScaleX, float& aScaleY,
gfx::Margin& aFixedLayerMargins,
float& aOffsetX, float& aOffsetY)
gfx::Point& aOffset)
{
#ifdef MOZ_WIDGET_ANDROID
AndroidBridge::Bridge()->SyncViewportInfo(aDisplayPort,
@ -585,7 +591,26 @@ AsyncCompositionManager::SyncViewportInfo(const nsIntRect& aDisplayPort,
aScrollOffset,
aScaleX, aScaleY,
aFixedLayerMargins,
aOffsetX, aOffsetY);
aOffset);
#endif
}
void
AsyncCompositionManager::SyncFrameMetrics(const gfx::Point& aScrollOffset,
float aZoom,
const gfx::Rect& aCssPageRect,
bool aLayersUpdated,
const gfx::Rect& aDisplayPort,
float aDisplayResolution,
bool aIsFirstPaint,
gfx::Margin& aFixedLayerMargins,
gfx::Point& aOffset)
{
#ifdef MOZ_WIDGET_ANDROID
AndroidBridge::Bridge()->SyncFrameMetrics(aScrollOffset, aZoom, aCssPageRect,
aLayersUpdated, aDisplayPort,
aDisplayResolution, aIsFirstPaint,
aFixedLayerMargins, aOffset);
#endif
}

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

@ -129,12 +129,16 @@ private:
nsIntPoint& aScrollOffset,
float& aScaleX, float& aScaleY,
gfx::Margin& aFixedLayerMargins,
float& aOffsetX, float& aOffsetY);
virtual void SyncFrameMetrics(Layer* aLayer, const ViewTransform& aTreeTransform,
const gfxPoint& aScrollOffset, gfx::Margin& aFixedLayerMargins,
float& aOffsetX, float& aOffsetY,
bool aIsFirstPaint, bool aLayersUpdated)
{}
gfx::Point& aOffset);
void SyncFrameMetrics(const gfx::Point& aScrollOffset,
float aZoom,
const gfx::Rect& aCssPageRect,
bool aLayersUpdated,
const gfx::Rect& aDisplayPort,
float aDisplayResolution,
bool aIsFirstPaint,
gfx::Margin& aFixedLayerMargins,
gfx::Point& aOffset);
/**
* Recursively applies the given translation to all top-level fixed position

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

@ -1115,7 +1115,7 @@ AsyncPanZoomController::FireAsyncScrollOnTimeout()
bool AsyncPanZoomController::SampleContentTransformForFrame(const TimeStamp& aSampleTime,
ContainerLayer* aLayer,
ViewTransform* aNewTransform,
gfxPoint* aScrollOffset) {
gfx::Point& aScrollOffset) {
// The eventual return value of this function. The compositor needs to know
// whether or not to advance by a frame as soon as it can. For example, if a
// fling is happening, it has to keep compositing so that the animation is
@ -1224,7 +1224,8 @@ bool AsyncPanZoomController::SampleContentTransformForFrame(const TimeStamp& aSa
gfxPoint scrollCompensation(
(scrollOffset / rootScale - metricsScrollOffset) * localScale);
*aNewTransform = ViewTransform(-scrollCompensation, localScale);
*aScrollOffset = scrollOffset * localScale;
aScrollOffset.x = scrollOffset.x * localScale.width;
aScrollOffset.y = scrollOffset.y * localScale.height;
mLastSampleTime = aSampleTime;

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

@ -178,7 +178,7 @@ public:
bool SampleContentTransformForFrame(const TimeStamp& aSampleTime,
ContainerLayer* aLayer,
ViewTransform* aNewTransform,
gfxPoint* aScrollOffset);
gfx::Point& aScrollOffset);
/**
* A shadow layer update has arrived. |aViewportFrame| is the new FrameMetrics

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

@ -245,7 +245,7 @@ gfxDWriteFontEntry::IsSymbolFont()
}
static bool
UsingArabicScriptSystemLocale()
UsingArabicOrHebrewScriptSystemLocale()
{
LANGID langid = PRIMARYLANGID(::GetSystemDefaultLangID());
switch (langid) {
@ -256,6 +256,7 @@ UsingArabicScriptSystemLocale()
case LANG_SINDHI:
case LANG_UIGHUR:
case LANG_URDU:
case LANG_HEBREW:
return true;
default:
return false;
@ -268,11 +269,12 @@ gfxDWriteFontEntry::GetFontTable(uint32_t aTableTag,
{
gfxDWriteFontList *pFontList = gfxDWriteFontList::PlatformFontList();
// don't use GDI table loading for symbol fonts or for
// Don't use GDI table loading for symbol fonts or for
// italic fonts in Arabic-script system locales because of
// potential cmap discrepancies, see bug 629386
// potential cmap discrepancies, see bug 629386.
// Ditto for Hebrew, bug 837498.
if (mFont && pFontList->UseGDIFontTableAccess() &&
!(mItalic && UsingArabicScriptSystemLocale()) &&
!(mItalic && UsingArabicOrHebrewScriptSystemLocale()) &&
!mFont->IsSymbolFont())
{
LOGFONTW logfont = { 0 };

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

@ -9,6 +9,7 @@
#include "jsapi.h"
#include "jsfriendapi.h"
#include "jsdbgapi.h"
#include "jswrapper.h"
#include "mozilla/ModuleUtils.h"
#include "nsServiceManagerUtils.h"
#include "nsMemory.h"
@ -45,7 +46,7 @@ JSDebugger::AddClass(const JS::Value &global, JSContext* cx)
}
JSObject* obj = &global.toObject();
obj = JS_UnwrapObjectAndInnerize(obj);
obj = js::UncheckedUnwrap(obj, /* stopAtOuter = */ false);
if (!obj) {
return NS_ERROR_FAILURE;
}

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

@ -11,6 +11,7 @@
#include "jsd.h"
#include "jsapi.h"
#include "jsfriendapi.h"
#include "jswrapper.h"
#ifdef DEBUG
void JSD_ASSERT_VALID_VALUE(JSDValue* jsdval)
@ -605,7 +606,7 @@ jsd_GetValueFunction(JSDContext* jsdc, JSDValue* jsdval)
if (JSVAL_IS_PRIMITIVE(jsdval->val))
return NULL;
obj = JS_UnwrapObject(JSVAL_TO_OBJECT(jsdval->val));
obj = js::UncheckedUnwrap(JSVAL_TO_OBJECT(jsdval->val));
oldCompartment = JS_EnterCompartment(jsdc->dumbContext, obj);
fun = JS_ValueToFunction(jsdc->dumbContext, OBJECT_TO_JSVAL(obj));
JS_LeaveCompartment(jsdc->dumbContext, oldCompartment);

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

@ -313,15 +313,6 @@ typedef MutableHandle<Value> MutableHandleValue;
namespace js {
/*
* Raw pointer used as documentation that a parameter does not need to be
* rooted.
*/
typedef JSObject * RawObject;
typedef JSString * RawString;
typedef jsid RawId;
typedef JS::Value RawValue;
/*
* InternalHandle is a handle to an internal pointer into a gcthing. Use
* InternalHandle when you have a pointer to a direct field of a gcthing, or
@ -380,20 +371,6 @@ class InternalHandle<T*>
{}
};
/*
* This macro simplifies forward declaration of a class and its matching raw-pointer.
*/
# define ForwardDeclare(type) \
class type; \
typedef type * Raw##type
# define ForwardDeclareJS(type) \
class JS##type; \
namespace js { \
typedef JS##type * Raw##type; \
} \
class JS##type
/*
* By default, pointers should use the inheritance hierarchy to find their
* ThingRootKind. Some pointer types are explicitly set in jspubtd.h so that
@ -824,8 +801,4 @@ class CompilerRootNode
} /* namespace js */
ForwardDeclareJS(Script);
ForwardDeclareJS(Function);
ForwardDeclareJS(Object);
#endif /* jsgc_root_h___ */

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

@ -9,6 +9,7 @@
#include "mozilla/Assertions.h"
#include "mozilla/Attributes.h"
#include "mozilla/Compiler.h"
#include "mozilla/Scoped.h"
#include <stdlib.h>
@ -229,8 +230,21 @@ __BitScanReverse64(unsigned __int64 val)
# define js_bitscan_clz64(val) __BitScanReverse64(val)
# define JS_HAS_BUILTIN_BITSCAN64
#endif
#elif (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
#elif MOZ_IS_GCC
#if MOZ_GCC_VERSION_AT_LEAST(3, 4, 0)
# define USE_BUILTIN_CTZ
#endif
#elif defined(__clang__)
#if __has_builtin(__builtin_ctz)
# define USE_BUILTIN_CTZ
#endif
#endif
#if defined(USE_BUILTIN_CTZ)
# define js_bitscan_ctz32(val) __builtin_ctz(val)
# define js_bitscan_clz32(val) __builtin_clz(val)
# define JS_HAS_BUILTIN_BITSCAN32
@ -240,6 +254,8 @@ __BitScanReverse64(unsigned __int64 val)
# define JS_HAS_BUILTIN_BITSCAN64
# endif
# undef USE_BUILTIN_CTZ
#endif
/*

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

@ -34,7 +34,7 @@ AssertInnerizedScopeChain(JSContext *cx, JSObject &scopeobj)
}
static bool
IsEvalCacheCandidate(RawScript script)
IsEvalCacheCandidate(JSScript *script)
{
// Make sure there are no inner objects which might use the wrong parent
// and/or call scope by reusing the previous eval's script. Skip the
@ -123,7 +123,7 @@ class EvalScriptGuard
}
}
void setNewScript(RawScript script) {
void setNewScript(JSScript *script) {
// JSScript::initFromEmitter has already called js_CallNewScriptHook.
JS_ASSERT(!script_ && script);
script_ = script;
@ -289,7 +289,7 @@ EvalKernel(JSContext *cx, const CallArgs &args, EvalType evalType, AbstractFrame
.setNoScriptRval(false)
.setPrincipals(principals)
.setOriginPrincipals(originPrincipals);
RawScript compiled = frontend::CompileScript(cx, scopeobj, callerScript, options,
JSScript *compiled = frontend::CompileScript(cx, scopeobj, callerScript, options,
chars.get(), length, stableStr, staticLevel);
if (!compiled)
return false;
@ -350,7 +350,7 @@ js::DirectEvalFromIon(JSContext *cx,
.setNoScriptRval(false)
.setPrincipals(principals)
.setOriginPrincipals(originPrincipals);
RawScript compiled = frontend::CompileScript(cx, scopeobj, callerScript, options,
JSScript *compiled = frontend::CompileScript(cx, scopeobj, callerScript, options,
chars.get(), length, stableStr, staticLevel);
if (!compiled)
return false;

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

@ -850,7 +850,7 @@ class js::MapIteratorObject : public JSObject
static const JSFunctionSpec methods[];
static MapIteratorObject *create(JSContext *cx, HandleObject mapobj, ValueMap *data,
MapObject::IteratorKind kind);
static void finalize(FreeOp *fop, RawObject obj);
static void finalize(FreeOp *fop, JSObject *obj);
private:
static inline bool is(const Value &v);
@ -942,7 +942,7 @@ MapIteratorObject::create(JSContext *cx, HandleObject mapobj, ValueMap *data,
}
void
MapIteratorObject::finalize(FreeOp *fop, RawObject obj)
MapIteratorObject::finalize(FreeOp *fop, JSObject *obj)
{
fop->delete_(obj->asMapIterator().range());
}
@ -1099,7 +1099,7 @@ MarkKey(Range &r, const HashableValue &key, JSTracer *trc)
}
void
MapObject::mark(JSTracer *trc, RawObject obj)
MapObject::mark(JSTracer *trc, JSObject *obj)
{
if (ValueMap *map = obj->asMap().getData()) {
for (ValueMap::Range r = map->all(); !r.empty(); r.popFront()) {
@ -1147,7 +1147,7 @@ WriteBarrierPost(JSRuntime *rt, TableType *table, const HashableValue &key)
}
void
MapObject::finalize(FreeOp *fop, RawObject obj)
MapObject::finalize(FreeOp *fop, JSObject *obj)
{
if (ValueMap *map = obj->asMap().getData())
fop->delete_(map);
@ -1422,7 +1422,7 @@ class js::SetIteratorObject : public JSObject
enum { TargetSlot, RangeSlot, SlotCount };
static const JSFunctionSpec methods[];
static SetIteratorObject *create(JSContext *cx, HandleObject setobj, ValueSet *data);
static void finalize(FreeOp *fop, RawObject obj);
static void finalize(FreeOp *fop, JSObject *obj);
private:
static inline bool is(const Value &v);
@ -1502,7 +1502,7 @@ SetIteratorObject::create(JSContext *cx, HandleObject setobj, ValueSet *data)
}
void
SetIteratorObject::finalize(FreeOp *fop, RawObject obj)
SetIteratorObject::finalize(FreeOp *fop, JSObject *obj)
{
fop->delete_(obj->asSetIterator().range());
}
@ -1589,7 +1589,7 @@ SetObject::initClass(JSContext *cx, JSObject *obj)
}
void
SetObject::mark(JSTracer *trc, RawObject obj)
SetObject::mark(JSTracer *trc, JSObject *obj)
{
SetObject *setobj = static_cast<SetObject *>(obj);
if (ValueSet *set = setobj->getData()) {
@ -1599,7 +1599,7 @@ SetObject::mark(JSTracer *trc, RawObject obj)
}
void
SetObject::finalize(FreeOp *fop, RawObject obj)
SetObject::finalize(FreeOp *fop, JSObject *obj)
{
SetObject *setobj = static_cast<SetObject *>(obj);
if (ValueSet *set = setobj->getData())

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

@ -97,8 +97,8 @@ class MapObject : public JSObject {
static const JSFunctionSpec methods[];
ValueMap *getData() { return static_cast<ValueMap *>(getPrivate()); }
static ValueMap & extract(CallReceiver call);
static void mark(JSTracer *trc, RawObject obj);
static void finalize(FreeOp *fop, RawObject obj);
static void mark(JSTracer *trc, JSObject *obj);
static void finalize(FreeOp *fop, JSObject *obj);
static JSBool construct(JSContext *cx, unsigned argc, Value *vp);
static bool is(const Value &v);
@ -134,8 +134,8 @@ class SetObject : public JSObject {
static const JSFunctionSpec methods[];
ValueSet *getData() { return static_cast<ValueSet *>(getPrivate()); }
static ValueSet & extract(CallReceiver call);
static void mark(JSTracer *trc, RawObject obj);
static void finalize(FreeOp *fop, RawObject obj);
static void mark(JSTracer *trc, JSObject *obj);
static void finalize(FreeOp *fop, JSObject *obj);
static JSBool construct(JSContext *cx, unsigned argc, Value *vp);
static bool is(const Value &v);

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

@ -183,7 +183,7 @@ obj_toSource(JSContext *cx, unsigned argc, Value *vp)
}
/* Convert id to a linear string. */
RawString s = ToString<CanGC>(cx, IdToValue(id));
JSString *s = ToString<CanGC>(cx, IdToValue(id));
if (!s)
return false;
Rooted<JSLinearString*> idstr(cx, s->ensureLinear(cx));
@ -278,7 +278,7 @@ obj_toSource(JSContext *cx, unsigned argc, Value *vp)
if (outermost && !buf.append(')'))
return false;
RawString str = buf.finishString();
JSString *str = buf.finishString();
if (!str)
return false;
args.rval().setString(str);
@ -324,7 +324,7 @@ obj_toString(JSContext *cx, unsigned argc, Value *vp)
return false;
/* Steps 4-5. */
RawString str = JS_BasicObjectToString(cx, obj);
JSString *str = JS_BasicObjectToString(cx, obj);
if (!str)
return false;
args.rval().setString(str);

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

@ -200,7 +200,7 @@ EscapeNakedForwardSlashes(JSContext *cx, HandleAtom unescaped)
return NULL;
}
return sb.empty() ? RawAtom(unescaped) : sb.finishAtom();
return sb.empty() ? (JSAtom *)unescaped : sb.finishAtom();
}
/*
@ -366,7 +366,7 @@ regexp_toString_impl(JSContext *cx, CallArgs args)
{
JS_ASSERT(IsRegExp(args.thisv()));
RawString str = args.thisv().toObject().asRegExp().toString(cx);
JSString *str = args.thisv().toObject().asRegExp().toString(cx);
if (!str)
return false;

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

@ -1750,7 +1750,7 @@ ia64*-hpux*)
XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE -NXCOMPAT"
LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE -NXCOMPAT -RELEASE"
dnl For profile-guided optimization
PROFILE_GEN_CFLAGS="-GL"
PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
@ -2294,9 +2294,6 @@ else
AC_MSG_ERROR([Unexpected JS_BYTES_PER_WORD])
fi
MOZ_ALIGN_OF_TYPE(JS_ALIGN_OF_POINTER, void*, 2 4 8 16)
MOZ_SIZE_OF_TYPE(JS_BYTES_PER_DOUBLE, double, 6 8 10 12 14)
MOZ_CHECK_HEADERS(endian.h)
if test "$ac_cv_header_endian_h" = yes; then
AC_DEFINE(JS_HAVE_ENDIAN_H)
@ -2914,34 +2911,6 @@ if test "$GNU_CC"; then
TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc3}"
fi
dnl Check for support of modern template specialization syntax
dnl Test code and requirement from scc@netscape.com.
dnl Autoconf cut-and-paste job by waterson@netscape.com
AC_CACHE_CHECK(for modern C++ template specialization syntax support,
ac_cv_cpp_modern_specialize_template_syntax,
[AC_TRY_COMPILE(template <class T> struct X { int a; };
class Y {};
template <> struct X<Y> { double a; };,
X<int> int_x;
X<Y> y_x;,
ac_cv_cpp_modern_specialize_template_syntax=yes,
ac_cv_cpp_modern_specialize_template_syntax=no)])
if test "$ac_cv_cpp_modern_specialize_template_syntax" = no ; then
AC_MSG_ERROR([The C++ compiler does not support template specialization])
fi
dnl Some compilers support only full specialization, and some don't.
AC_CACHE_CHECK(whether partial template specialization works,
ac_cv_cpp_partial_specialization,
[AC_TRY_COMPILE(template <class T> class Foo {};
template <class T> class Foo<T*> {};,
return 0;,
ac_cv_cpp_partial_specialization=yes,
ac_cv_cpp_partial_specialization=no)])
if test "$ac_cv_cpp_partial_specialization" = yes ; then
AC_DEFINE(HAVE_CPP_PARTIAL_SPECIALIZATION)
fi
dnl Check to see if we can resolve ambiguity with |using|.
AC_CACHE_CHECK(whether the C++ \"using\" keyword resolves ambiguity,
ac_cv_cpp_ambiguity_resolving_using,

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

@ -38,7 +38,7 @@ CheckLength(JSContext *cx, size_t length)
}
static bool
SetSourceMap(JSContext *cx, TokenStream &tokenStream, ScriptSource *ss, RawScript script)
SetSourceMap(JSContext *cx, TokenStream &tokenStream, ScriptSource *ss, JSScript *script)
{
if (tokenStream.hasSourceMap()) {
if (!ss->setSourceMap(cx, tokenStream.releaseSourceMap(), script->filename()))
@ -74,7 +74,7 @@ CheckArgumentsWithinEval(JSContext *cx, Parser<FullParseHandler> &parser, Handle
return true;
}
RawScript
JSScript *
frontend::CompileScript(JSContext *cx, HandleObject scopeChain,
HandleScript evalCaller,
const CompileOptions &options,

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

@ -12,7 +12,7 @@
namespace js {
namespace frontend {
RawScript
JSScript *
CompileScript(JSContext *cx, HandleObject scopeChain, HandleScript evalCaller,
const CompileOptions &options, const jschar *chars, size_t length,
JSString *source_ = NULL, unsigned staticLevel = 0,

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

@ -245,7 +245,7 @@ class NameResolver
if (buf.empty())
return NULL;
RawAtom atom = buf.finishAtom();
JSAtom *atom = buf.finishAtom();
fun->setGuessedAtom(atom);
return atom;
}

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

@ -123,7 +123,7 @@ frontend::LexicalLookup(ContextT *ct, HandleAtom atom, int *slotp, typename Cont
continue;
StaticBlockObject &blockObj = *stmt->blockObj;
RawShape shape = blockObj.nativeLookup(ct->sc->context, id);
Shape *shape = blockObj.nativeLookup(ct->sc->context, id);
if (shape) {
JS_ASSERT(shape->hasShortID());

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

@ -66,10 +66,10 @@ static inline void
PushMarkStack(GCMarker *gcmarker, JSFunction *thing);
static inline void
PushMarkStack(GCMarker *gcmarker, RawScript thing);
PushMarkStack(GCMarker *gcmarker, JSScript *thing);
static inline void
PushMarkStack(GCMarker *gcmarker, RawShape thing);
PushMarkStack(GCMarker *gcmarker, Shape *thing);
static inline void
PushMarkStack(GCMarker *gcmarker, JSString *thing);
@ -81,9 +81,9 @@ namespace js {
namespace gc {
static void MarkChildren(JSTracer *trc, JSString *str);
static void MarkChildren(JSTracer *trc, RawScript script);
static void MarkChildren(JSTracer *trc, RawShape shape);
static void MarkChildren(JSTracer *trc, RawBaseShape base);
static void MarkChildren(JSTracer *trc, JSScript *script);
static void MarkChildren(JSTracer *trc, Shape *shape);
static void MarkChildren(JSTracer *trc, BaseShape *base);
static void MarkChildren(JSTracer *trc, types::TypeObject *type);
static void MarkChildren(JSTracer *trc, ion::IonCode *code);
@ -383,19 +383,19 @@ gc::MarkKind(JSTracer *trc, void **thingp, JSGCTraceKind kind)
JS_ASSERT_IF(cell->isTenured(), kind == MapAllocToTraceKind(cell->tenuredGetAllocKind()));
switch (kind) {
case JSTRACE_OBJECT:
MarkInternal(trc, reinterpret_cast<RawObject *>(thingp));
MarkInternal(trc, reinterpret_cast<JSObject **>(thingp));
break;
case JSTRACE_STRING:
MarkInternal(trc, reinterpret_cast<RawString *>(thingp));
MarkInternal(trc, reinterpret_cast<JSString **>(thingp));
break;
case JSTRACE_SCRIPT:
MarkInternal(trc, reinterpret_cast<RawScript *>(thingp));
MarkInternal(trc, reinterpret_cast<JSScript **>(thingp));
break;
case JSTRACE_SHAPE:
MarkInternal(trc, reinterpret_cast<RawShape *>(thingp));
MarkInternal(trc, reinterpret_cast<Shape **>(thingp));
break;
case JSTRACE_BASE_SHAPE:
MarkInternal(trc, reinterpret_cast<RawBaseShape *>(thingp));
MarkInternal(trc, reinterpret_cast<BaseShape **>(thingp));
break;
case JSTRACE_TYPE_OBJECT:
MarkInternal(trc, reinterpret_cast<types::TypeObject **>(thingp));
@ -652,7 +652,7 @@ gc::MarkObjectSlots(JSTracer *trc, JSObject *obj, uint32_t start, uint32_t nslot
}
static bool
ShouldMarkCrossCompartment(JSTracer *trc, RawObject src, Cell *cell)
ShouldMarkCrossCompartment(JSTracer *trc, JSObject *src, Cell *cell)
{
if (!IS_GC_MARKING_TRACER(trc))
return true;
@ -690,22 +690,22 @@ ShouldMarkCrossCompartment(JSTracer *trc, RawObject src, Cell *cell)
}
void
gc::MarkCrossCompartmentObjectUnbarriered(JSTracer *trc, RawObject src, JSObject **dst, const char *name)
gc::MarkCrossCompartmentObjectUnbarriered(JSTracer *trc, JSObject *src, JSObject **dst, const char *name)
{
if (ShouldMarkCrossCompartment(trc, src, *dst))
MarkObjectUnbarriered(trc, dst, name);
}
void
gc::MarkCrossCompartmentScriptUnbarriered(JSTracer *trc, RawObject src, JSScript **dst,
const char *name)
gc::MarkCrossCompartmentScriptUnbarriered(JSTracer *trc, JSObject *src, JSScript **dst,
const char *name)
{
if (ShouldMarkCrossCompartment(trc, src, *dst))
MarkScriptUnbarriered(trc, dst, name);
}
void
gc::MarkCrossCompartmentSlot(JSTracer *trc, RawObject src, HeapSlot *dst, const char *name)
gc::MarkCrossCompartmentSlot(JSTracer *trc, JSObject *src, HeapSlot *dst, const char *name)
{
if (dst->isMarkable() && ShouldMarkCrossCompartment(trc, src, (Cell *)dst->toGCThing()))
MarkSlot(trc, dst, name);
@ -714,7 +714,7 @@ gc::MarkCrossCompartmentSlot(JSTracer *trc, RawObject src, HeapSlot *dst, const
/*** Special Marking ***/
void
gc::MarkObject(JSTracer *trc, HeapPtr<GlobalObject, RawScript> *thingp, const char *name)
gc::MarkObject(JSTracer *trc, HeapPtr<GlobalObject, JSScript *> *thingp, const char *name)
{
JS_SET_TRACING_NAME(trc, name);
MarkInternal(trc, thingp->unsafeGet());
@ -779,7 +779,7 @@ PushMarkStack(GCMarker *gcmarker, types::TypeObject *thing)
}
static void
PushMarkStack(GCMarker *gcmarker, RawScript thing)
PushMarkStack(GCMarker *gcmarker, JSScript *thing)
{
JS_COMPARTMENT_ASSERT(gcmarker->runtime, thing);
JS_ASSERT(!IsInsideNursery(thing->runtime(), thing));
@ -794,10 +794,10 @@ PushMarkStack(GCMarker *gcmarker, RawScript thing)
}
static void
ScanShape(GCMarker *gcmarker, RawShape shape);
ScanShape(GCMarker *gcmarker, Shape *shape);
static void
PushMarkStack(GCMarker *gcmarker, RawShape thing)
PushMarkStack(GCMarker *gcmarker, Shape *thing)
{
JS_COMPARTMENT_ASSERT(gcmarker->runtime, thing);
JS_ASSERT(!IsInsideNursery(thing->runtime(), thing));
@ -818,10 +818,10 @@ PushMarkStack(GCMarker *gcmarker, ion::IonCode *thing)
}
static inline void
ScanBaseShape(GCMarker *gcmarker, RawBaseShape base);
ScanBaseShape(GCMarker *gcmarker, BaseShape *base);
static void
PushMarkStack(GCMarker *gcmarker, RawBaseShape thing)
PushMarkStack(GCMarker *gcmarker, BaseShape *thing)
{
JS_COMPARTMENT_ASSERT(gcmarker->runtime, thing);
JS_ASSERT(!IsInsideNursery(thing->runtime(), thing));
@ -832,7 +832,7 @@ PushMarkStack(GCMarker *gcmarker, RawBaseShape thing)
}
static void
ScanShape(GCMarker *gcmarker, RawShape shape)
ScanShape(GCMarker *gcmarker, Shape *shape)
{
restart:
PushMarkStack(gcmarker, shape->base());
@ -849,7 +849,7 @@ ScanShape(GCMarker *gcmarker, RawShape shape)
}
static inline void
ScanBaseShape(GCMarker *gcmarker, RawBaseShape base)
ScanBaseShape(GCMarker *gcmarker, BaseShape *base)
{
base->assertConsistency();
@ -873,7 +873,7 @@ ScanBaseShape(GCMarker *gcmarker, RawBaseShape base)
* unowned base shape.
*/
if (base->isOwned()) {
RawUnownedBaseShape unowned = base->baseUnowned();
UnownedBaseShape *unowned = base->baseUnowned();
JS_ASSERT(base->compartment() == unowned->compartment());
unowned->markIfUnmarked(gcmarker->getMarkColor());
}
@ -993,19 +993,19 @@ gc::MarkChildren(JSTracer *trc, JSString *str)
}
static void
gc::MarkChildren(JSTracer *trc, RawScript script)
gc::MarkChildren(JSTracer *trc, JSScript *script)
{
script->markChildren(trc);
}
static void
gc::MarkChildren(JSTracer *trc, RawShape shape)
gc::MarkChildren(JSTracer *trc, Shape *shape)
{
shape->markChildren(trc);
}
static void
gc::MarkChildren(JSTracer *trc, RawBaseShape base)
gc::MarkChildren(JSTracer *trc, BaseShape *base)
{
base->markChildren(trc);
}
@ -1019,7 +1019,7 @@ gc::MarkChildren(JSTracer *trc, RawBaseShape base)
* updated to the current shape's parent.
*/
static inline void
MarkCycleCollectorChildren(JSTracer *trc, RawBaseShape base, JSObject **prevParent)
MarkCycleCollectorChildren(JSTracer *trc, BaseShape *base, JSObject **prevParent)
{
JS_ASSERT(base);
@ -1059,7 +1059,7 @@ MarkCycleCollectorChildren(JSTracer *trc, RawBaseShape base, JSObject **prevPare
* parent pointer will only be marked once.
*/
void
gc::MarkCycleCollectorChildren(JSTracer *trc, RawShape shape)
gc::MarkCycleCollectorChildren(JSTracer *trc, Shape *shape)
{
JSObject *prevParent = NULL;
do {
@ -1400,7 +1400,7 @@ GCMarker::processMarkStackTop(SliceBudget &budget)
types::TypeObject *type = obj->typeFromGC();
PushMarkStack(this, type);
RawShape shape = obj->lastProperty();
Shape *shape = obj->lastProperty();
PushMarkStack(this, shape);
/* Call the trace hook if necessary. */
@ -1491,19 +1491,19 @@ js::TraceChildren(JSTracer *trc, void *thing, JSGCTraceKind kind)
{
switch (kind) {
case JSTRACE_OBJECT:
MarkChildren(trc, static_cast<RawObject>(thing));
MarkChildren(trc, static_cast<JSObject *>(thing));
break;
case JSTRACE_STRING:
MarkChildren(trc, static_cast<RawString>(thing));
MarkChildren(trc, static_cast<JSString *>(thing));
break;
case JSTRACE_SCRIPT:
MarkChildren(trc, static_cast<RawScript>(thing));
MarkChildren(trc, static_cast<JSScript *>(thing));
break;
case JSTRACE_SHAPE:
MarkChildren(trc, static_cast<RawShape>(thing));
MarkChildren(trc, static_cast<Shape *>(thing));
break;
case JSTRACE_IONCODE:
@ -1511,7 +1511,7 @@ js::TraceChildren(JSTracer *trc, void *thing, JSGCTraceKind kind)
break;
case JSTRACE_BASE_SHAPE:
MarkChildren(trc, static_cast<RawBaseShape>(thing));
MarkChildren(trc, static_cast<BaseShape *>(thing));
break;
case JSTRACE_TYPE_OBJECT:

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

@ -204,11 +204,11 @@ void
MarkObjectSlots(JSTracer *trc, JSObject *obj, uint32_t start, uint32_t nslots);
void
MarkCrossCompartmentObjectUnbarriered(JSTracer *trc, RawObject src, JSObject **dst_obj,
MarkCrossCompartmentObjectUnbarriered(JSTracer *trc, JSObject *src, JSObject **dst_obj,
const char *name);
void
MarkCrossCompartmentScriptUnbarriered(JSTracer *trc, RawObject src, JSScript **dst_script,
MarkCrossCompartmentScriptUnbarriered(JSTracer *trc, JSObject *src, JSScript **dst_script,
const char *name);
/*
@ -216,7 +216,7 @@ MarkCrossCompartmentScriptUnbarriered(JSTracer *trc, RawObject src, JSScript **d
* being GC'd. (Although it won't be marked if it's in the wrong compartment.)
*/
void
MarkCrossCompartmentSlot(JSTracer *trc, RawObject src, HeapSlot *dst_slot, const char *name);
MarkCrossCompartmentSlot(JSTracer *trc, JSObject *src, HeapSlot *dst_slot, const char *name);
/*** Special Cases ***/
@ -245,7 +245,7 @@ MarkChildren(JSTracer *trc, JSObject *obj);
* JS_TraceShapeCycleCollectorChildren.
*/
void
MarkCycleCollectorChildren(JSTracer *trc, RawShape shape);
MarkCycleCollectorChildren(JSTracer *trc, Shape *shape);
void
PushArena(GCMarker *gcmarker, ArenaHeader *aheader);

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

@ -484,8 +484,8 @@ AutoGCRooter::trace(JSTracer *trc)
case OBJOBJHASHMAP: {
AutoObjectObjectHashMap::HashMapImpl &map = static_cast<AutoObjectObjectHashMap *>(this)->map;
for (AutoObjectObjectHashMap::Enum e(map); !e.empty(); e.popFront()) {
mozilla::DebugOnly<RawObject> key = e.front().key;
MarkObjectRoot(trc, (RawObject *) &e.front().key, "AutoObjectObjectHashMap key");
mozilla::DebugOnly<JSObject *> key = e.front().key;
MarkObjectRoot(trc, const_cast<JSObject **>(&e.front().key), "AutoObjectObjectHashMap key");
JS_ASSERT(key == e.front().key); // Needs rewriting for moving GC, see bug 726687.
MarkObjectRoot(trc, &e.front().value, "AutoObjectObjectHashMap value");
}
@ -496,8 +496,8 @@ AutoGCRooter::trace(JSTracer *trc)
AutoObjectUnsigned32HashMap *self = static_cast<AutoObjectUnsigned32HashMap *>(this);
AutoObjectUnsigned32HashMap::HashMapImpl &map = self->map;
for (AutoObjectUnsigned32HashMap::Enum e(map); !e.empty(); e.popFront()) {
mozilla::DebugOnly<RawObject> key = e.front().key;
MarkObjectRoot(trc, (RawObject *) &e.front().key, "AutoObjectUnsignedHashMap key");
mozilla::DebugOnly<JSObject *> key = e.front().key;
MarkObjectRoot(trc, const_cast<JSObject **>(&e.front().key), "AutoObjectUnsignedHashMap key");
JS_ASSERT(key == e.front().key); // Needs rewriting for moving GC, see bug 726687.
}
return;
@ -507,8 +507,8 @@ AutoGCRooter::trace(JSTracer *trc)
AutoObjectHashSet *self = static_cast<AutoObjectHashSet *>(this);
AutoObjectHashSet::HashSetImpl &set = self->set;
for (AutoObjectHashSet::Enum e(set); !e.empty(); e.popFront()) {
mozilla::DebugOnly<RawObject> obj = e.front();
MarkObjectRoot(trc, (RawObject *) &e.front(), "AutoObjectHashSet value");
mozilla::DebugOnly<JSObject *> obj = e.front();
MarkObjectRoot(trc, const_cast<JSObject **>(&e.front()), "AutoObjectHashSet value");
JS_ASSERT(obj == e.front()); // Needs rewriting for moving GC, see bug 726687.
}
return;
@ -649,6 +649,30 @@ JSPropertyDescriptor::trace(JSTracer *trc)
}
}
static inline void
MarkGlobalForMinorGC(JSTracer *trc, JSCompartment *compartment)
{
#ifdef JS_ION
/*
* Named properties of globals which have had Ion activity are treated as
* roots during minor GCs. This allows writes to globals to occur without
* needing a write barrier.
*/
JS_ASSERT(trc->runtime->isHeapMinorCollecting());
if (!compartment->ionCompartment())
return;
GlobalObject *global = compartment->maybeGlobal();
if (!global)
return;
/* Global reserved slots never hold nursery things. */
for (size_t i = JSCLASS_RESERVED_SLOTS(global->getClass()); i < global->slotSpan(); ++i)
MarkValueRoot(trc, global->nativeGetSlotRef(i).unsafeGet(), "MinorGlobalRoot");
#endif /* JS_ION */
}
void
js::gc::MarkRuntime(JSTracer *trc, bool useSavedRoots)
{
@ -737,6 +761,9 @@ js::gc::MarkRuntime(JSTracer *trc, bool useSavedRoots)
if (IS_GC_MARKING_TRACER(trc) && !c->zone()->isCollecting())
continue;
if (trc->runtime->isHeapMinorCollecting())
MarkGlobalForMinorGC(trc, c);
/* During a GC, these are treated as weak pointers. */
if (!IS_GC_MARKING_TRACER(trc)) {
if (c->watchpointMap)

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

@ -12,8 +12,8 @@ FRAGMENT(JSObject, simple) {
JSObject &plainRef = *plain;
JSFunction &funcRef = *funcPtr;
js::RawObject plainRaw = plain;
js::RawObject funcRaw = func;
JSObject *plainRaw = plain;
JSObject *funcRaw = func;
breakpoint();
@ -30,7 +30,7 @@ FRAGMENT(JSObject, simple) {
FRAGMENT(JSObject, null) {
JS::Rooted<JSObject *> null(cx, NULL);
js::RawObject nullRaw = null;
JSObject *nullRaw = null;
breakpoint();

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

@ -18,5 +18,3 @@ assert_pretty('funcPtr', '(JSFunction *) [object Function "formFollows"]')
assert_pretty('plainRef', '(JSObject &) @ [object Object]')
assert_pretty('funcRef', '(JSFunction &) @ [object Function "formFollows"]')
assert_pretty('plainRaw', '(js::RawObject) [object Object]')
assert_pretty('funcRaw', '(js::RawObject) [object Function "dys"]')

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

@ -24,7 +24,7 @@ FRAGMENT(JSString, simple) {
JS::Rooted<JSString *> doubleStars(cx, JS_ConcatStrings(cx, stars, stars));
// Ensure we're not confused by typedefs for pointer types.
js::RawString xRaw = x;
JSString *xRaw = x;
breakpoint();
@ -39,7 +39,7 @@ FRAGMENT(JSString, simple) {
FRAGMENT(JSString, null) {
JS::Rooted<JSString *> null(cx, NULL);
js::RawString nullRaw = null;
JSString *nullRaw = null;
breakpoint();

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

@ -2281,7 +2281,7 @@ class FunctionCompiler
// An AsmJSModule object is created at the end of module compilation and
// subsequently owned by an AsmJSModuleClass JSObject.
static void AsmJSModuleObject_finalize(FreeOp *fop, RawObject obj);
static void AsmJSModuleObject_finalize(FreeOp *fop, JSObject *obj);
static void AsmJSModuleObject_trace(JSTracer *trc, JSObject *obj);
static const unsigned ASM_CODE_RESERVED_SLOT = 0;
@ -2334,7 +2334,7 @@ js::SetAsmJSModuleObject(JSFunction *moduleFun, JSObject *moduleObj)
}
static void
AsmJSModuleObject_finalize(FreeOp *fop, RawObject obj)
AsmJSModuleObject_finalize(FreeOp *fop, JSObject *obj)
{
fop->delete_(&AsmJSModuleObjectToModule(obj));
}

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

@ -434,7 +434,7 @@ class AsmJSModule
return functionCounts_.append(counts);
}
bool addExportedFunction(RawFunction fun, PropertyName *maybeFieldName,
bool addExportedFunction(JSFunction *fun, PropertyName *maybeFieldName,
MoveRef<ArgCoercionVector> argCoercions, ReturnType returnType)
{
ExportedFunction func(fun, maybeFieldName, argCoercions, returnType);

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

@ -62,7 +62,7 @@ IonBailoutIterator::dump() const
}
}
static RawScript
static JSScript *
GetBailedJSScript(JSContext *cx)
{
// Just after the frame conversion, we can safely interpret the ionTop as JS
@ -530,7 +530,7 @@ uint32_t
ion::BoundsCheckFailure()
{
JSContext *cx = GetIonContext()->cx;
RawScript script = GetBailedJSScript(cx);
JSScript *script = GetBailedJSScript(cx);
IonSpew(IonSpew_Bailouts, "Bounds check failure %s:%d", script->filename(),
script->lineno);
@ -551,7 +551,7 @@ uint32_t
ion::ShapeGuardFailure()
{
JSContext *cx = GetIonContext()->cx;
RawScript script = GetBailedJSScript(cx);
JSScript *script = GetBailedJSScript(cx);
JS_ASSERT(!script->ionScript()->invalidated());
@ -566,7 +566,7 @@ uint32_t
ion::CachedShapeGuardFailure()
{
JSContext *cx = GetIonContext()->cx;
RawScript script = GetBailedJSScript(cx);
JSScript *script = GetBailedJSScript(cx);
JS_ASSERT(!script->ionScript()->invalidated());

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

@ -1689,7 +1689,7 @@ BaselineCompiler::getScopeCoordinateAddress(Register reg)
for (unsigned i = sc.hops; i; i--)
masm.extractObject(Address(reg, ScopeObject::offsetOfEnclosingScope()), reg);
RawShape shape = ScopeCoordinateToStaticScopeShape(cx, script, pc);
Shape *shape = ScopeCoordinateToStaticScopeShape(cx, script, pc);
Address addr;
if (shape->numFixedSlots() <= sc.slot) {
masm.loadPtr(Address(reg, JSObject::offsetOfSlots()), reg);

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

@ -781,7 +781,7 @@ PrepareOsrTempData(JSContext *cx, ICUseCount_Fallback *stub, BaselineFrame *fram
*((JSFunction **) (stackFrame + StackFrame::offsetOfExec())) = frame->fun();
*((uint32_t *) (stackFrame + StackFrame::offsetOfFlags())) = StackFrame::FUNCTION;
} else {
*((RawScript *) (stackFrame + StackFrame::offsetOfExec())) = frame->script();
*((JSScript **) (stackFrame + StackFrame::offsetOfExec())) = frame->script();
*((uint32_t *) (stackFrame + StackFrame::offsetOfFlags())) = 0;
}
@ -1268,7 +1268,7 @@ ICTypeMonitor_TypeObject::Compiler::generateStubCode(MacroAssembler &masm)
bool
ICUpdatedStub::addUpdateStubForValue(JSContext *cx, HandleScript script, HandleObject obj,
RawId id, HandleValue val)
jsid id, HandleValue val)
{
if (numOptimizedStubs_ >= MAX_OPTIMIZED_STUBS) {
// TODO: if the TypeSet becomes unknown or has the AnyObject type,
@ -1531,7 +1531,7 @@ DoNewArray(JSContext *cx, ICNewArray_Fallback *stub, uint32_t length,
{
FallbackICSpew(cx, stub, "NewArray");
RawObject obj = NewInitArray(cx, length, type);
JSObject *obj = NewInitArray(cx, length, type);
if (!obj)
return false;
@ -1565,7 +1565,7 @@ DoNewObject(JSContext *cx, ICNewObject_Fallback *stub, HandleObject templateObje
{
FallbackICSpew(cx, stub, "NewObject");
RawObject obj = NewInitObject(cx, templateObject);
JSObject *obj = NewInitObject(cx, templateObject);
if (!obj)
return false;
@ -1659,7 +1659,7 @@ DoCompareFallback(JSContext *cx, BaselineFrame *frame, ICCompare_Fallback *stub,
return true;
}
RawScript script = frame->script();
JSScript *script = frame->script();
// Try to generate new stubs.
if (lhs.isInt32() && rhs.isInt32()) {
@ -2070,7 +2070,7 @@ DoToBoolFallback(JSContext *cx, BaselineFrame *frame, ICToBool_Fallback *stub, H
JS_ASSERT(!arg.isBoolean());
RawScript script = frame->script();
JSScript *script = frame->script();
// Try to generate new stubs.
if (arg.isInt32()) {
@ -2568,9 +2568,9 @@ DoConcatStrings(JSContext *cx, HandleValue lhs, HandleValue rhs, MutableHandleVa
{
JS_ASSERT(lhs.isString());
JS_ASSERT(rhs.isString());
RawString lstr = lhs.toString();
RawString rstr = rhs.toString();
RawString result = ConcatStrings<NoGC>(cx, lstr, rstr);
JSString *lstr = lhs.toString();
JSString *rstr = rhs.toString();
JSString *result = ConcatStrings<NoGC>(cx, lstr, rstr);
if (result) {
res.set(StringValue(result));
return true;
@ -2609,7 +2609,7 @@ ICBinaryArith_StringConcat::Compiler::generateStubCode(MacroAssembler &masm)
return true;
}
static RawString
static JSString *
ConvertObjectToStringForConcat(JSContext *cx, HandleValue obj)
{
JS_ASSERT(obj.isObject());
@ -2623,8 +2623,8 @@ static bool
DoConcatStringObject(JSContext *cx, bool lhsIsString, HandleValue lhs, HandleValue rhs,
MutableHandleValue res)
{
RawString lstr = NULL;
RawString rstr = NULL;
JSString *lstr = NULL;
JSString *rstr = NULL;
if (lhsIsString) {
// Convert rhs first.
JS_ASSERT(lhs.isString() && rhs.isObject());

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

@ -915,7 +915,7 @@ class ICUpdatedStub : public ICStub
public:
bool initUpdatingChain(JSContext *cx, ICStubSpace *space);
bool addUpdateStubForValue(JSContext *cx, HandleScript script, HandleObject obj, RawId id,
bool addUpdateStubForValue(JSContext *cx, HandleScript script, HandleObject obj, jsid id,
HandleValue val);
void addOptimizedUpdateStub(ICStub *stub) {
@ -2980,7 +2980,7 @@ class ICGetElem_Dense : public ICMonitoredStub
bool generateStubCode(MacroAssembler &masm);
public:
Compiler(JSContext *cx, ICStub *firstMonitorStub, RawShape shape)
Compiler(JSContext *cx, ICStub *firstMonitorStub, Shape *shape)
: ICStubCompiler(cx, ICStub::GetElem_Dense),
firstMonitorStub_(firstMonitorStub),
shape_(cx, shape)
@ -3030,7 +3030,7 @@ class ICGetElem_TypedArray : public ICStub
}
public:
Compiler(JSContext *cx, RawShape shape, uint32_t type)
Compiler(JSContext *cx, Shape *shape, uint32_t type)
: ICStubCompiler(cx, ICStub::GetElem_TypedArray),
shape_(cx, shape),
type_(type)
@ -3171,7 +3171,7 @@ class ICSetElem_Dense : public ICUpdatedStub
bool generateStubCode(MacroAssembler &masm);
public:
Compiler(JSContext *cx, RawShape shape, HandleTypeObject type)
Compiler(JSContext *cx, Shape *shape, HandleTypeObject type)
: ICStubCompiler(cx, ICStub::SetElem_Dense),
shape_(cx, shape),
type_(type)
@ -3338,7 +3338,7 @@ class ICSetElem_TypedArray : public ICStub
}
public:
Compiler(JSContext *cx, RawShape shape, uint32_t type, bool expectOutOfBounds)
Compiler(JSContext *cx, Shape *shape, uint32_t type, bool expectOutOfBounds)
: ICStubCompiler(cx, ICStub::SetElem_TypedArray),
shape_(cx, shape),
type_(type),

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

@ -42,7 +42,7 @@ BaselineInspector::maybeShapesForPropertyOp(jsbytecode *pc, Vector<Shape *> &sha
ICStub *stub = entry.firstStub();
while (stub->next()) {
RawShape shape;
Shape *shape;
if (stub->isGetProp_Native()) {
shape = stub->toGetProp_Native()->shape();
} else if (stub->isSetProp_Native()) {

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

@ -49,7 +49,7 @@ class BaselineInspector
ICEntry *prevLookedUpEntry;
public:
BaselineInspector(JSContext *cx, RawScript rawScript)
BaselineInspector(JSContext *cx, JSScript *rawScript)
: script(cx, rawScript), prevLookedUpEntry(NULL)
{
JS_ASSERT(script);

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

@ -659,7 +659,7 @@ BaselineScript::pcForReturnAddress(JSScript *script, uint8_t *nativeAddress)
}
void
BaselineScript::toggleDebugTraps(RawScript script, jsbytecode *pc)
BaselineScript::toggleDebugTraps(JSScript *script, jsbytecode *pc)
{
JS_ASSERT(script->baselineScript() == this);
@ -779,7 +779,7 @@ BaselineScript::purgeOptimizedStubs(Zone *zone)
}
void
ion::FinishDiscardBaselineScript(FreeOp *fop, RawScript script)
ion::FinishDiscardBaselineScript(FreeOp *fop, JSScript *script)
{
if (!script->hasBaselineScript())
return;

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

@ -243,7 +243,7 @@ struct BaselineScript
// Toggle debug traps (used for breakpoints and step mode) in the script.
// If |pc| is NULL, toggle traps for all ops in the script. Else, only
// toggle traps at |pc|.
void toggleDebugTraps(RawScript script, jsbytecode *pc);
void toggleDebugTraps(JSScript *script, jsbytecode *pc);
void toggleSPS(bool enable);
@ -268,7 +268,7 @@ IonExecStatus
EnterBaselineAtBranch(JSContext *cx, StackFrame *fp, jsbytecode *pc);
void
FinishDiscardBaselineScript(FreeOp *fop, RawScript script);
FinishDiscardBaselineScript(FreeOp *fop, JSScript *script);
void
SizeOfBaselineData(JSScript *script, JSMallocSizeOfFun mallocSizeOf, size_t *data,

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

@ -939,7 +939,7 @@ CodeGenerator::emitGetPropertyPolymorphic(LInstruction *ins, Register obj, Regis
Label next;
masm.branchPtr(Assembler::NotEqual, scratch, ImmGCPtr(mir->objShape(i)), &next);
RawShape shape = mir->shape(i);
Shape *shape = mir->shape(i);
if (shape->slot() < shape->numFixedSlots()) {
// Fixed slot.
masm.loadTypedOrValue(Address(obj, JSObject::getFixedSlotOffset(shape->slot())),
@ -996,7 +996,7 @@ CodeGenerator::emitSetPropertyPolymorphic(LInstruction *ins, Register obj, Regis
Label next;
masm.branchPtr(Assembler::NotEqual, scratch, ImmGCPtr(mir->objShape(i)), &next);
RawShape shape = mir->shape(i);
Shape *shape = mir->shape(i);
if (shape->slot() < shape->numFixedSlots()) {
// Fixed slot.
Address addr(obj, JSObject::getFixedSlotOffset(shape->slot()));
@ -1531,7 +1531,7 @@ CodeGenerator::visitCallKnown(LCallKnown *call)
Register calleereg = ToRegister(call->getFunction());
Register objreg = ToRegister(call->getTempObject());
uint32_t unusedStack = StackOffsetOfPassedArg(call->argslot());
RawFunction target = call->getSingleTarget();
JSFunction *target = call->getSingleTarget();
ExecutionMode executionMode = gen->info().executionMode();
Label end, uncompiled;
@ -1545,7 +1545,7 @@ CodeGenerator::visitCallKnown(LCallKnown *call)
// If the function is known to be uncompilable, just emit the call to
// Invoke in sequential mode, else mark as cannot compile.
JS_ASSERT(call->mir()->hasRootedScript());
RawScript targetScript = target->nonLazyScript();
JSScript *targetScript = target->nonLazyScript();
if (GetIonScript(targetScript, executionMode) == ION_DISABLED_SCRIPT) {
if (executionMode == ParallelExecution)
return false;
@ -1751,7 +1751,7 @@ CodeGenerator::visitApplyArgsGeneric(LApplyArgsGeneric *apply)
// If the function is known to be uncompilable, only emit the call to InvokeFunction.
ExecutionMode executionMode = gen->info().executionMode();
if (apply->hasSingleTarget()) {
RawFunction target = apply->getSingleTarget();
JSFunction *target = apply->getSingleTarget();
if (!CanIonCompile(target, executionMode)) {
if (!emitCallInvokeFunction(apply, copyreg))
return false;
@ -2220,7 +2220,7 @@ CodeGenerator::maybeCreateScriptCounts()
IonScriptCounts *counts = NULL;
CompileInfo *outerInfo = &gen->info();
RawScript script = outerInfo->script();
JSScript *script = outerInfo->script();
if (cx->runtime->profilingScripts) {
if (script && !script->hasScriptCounts && !script->initScriptCounts(cx))
@ -4929,7 +4929,7 @@ CodeGenerator::link()
// We encode safepoints after the OSI-point offsets have been determined.
encodeSafepoints();
RawScript script = gen->info().script();
JSScript *script = gen->info().script();
ExecutionMode executionMode = gen->info().executionMode();
JS_ASSERT(!HasIonScript(script, executionMode));
@ -6084,7 +6084,7 @@ typedef bool (*IsDelegateObjectFn)(JSContext *, HandleObject, HandleObject, JSBo
static const VMFunction IsDelegateObjectInfo = FunctionInfo<IsDelegateObjectFn>(IsDelegateObject);
bool
CodeGenerator::emitInstanceOf(LInstruction *ins, RawObject prototypeObject)
CodeGenerator::emitInstanceOf(LInstruction *ins, JSObject *prototypeObject)
{
// This path implements fun_hasInstance when the function's prototype is
// known to be prototypeObject.

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

@ -215,7 +215,7 @@ class CodeGenerator : public CodeGeneratorSpecific
bool visitCallDeleteProperty(LCallDeleteProperty *lir);
bool visitBitNotV(LBitNotV *lir);
bool visitBitOpV(LBitOpV *lir);
bool emitInstanceOf(LInstruction *ins, RawObject prototypeObject);
bool emitInstanceOf(LInstruction *ins, JSObject *prototypeObject);
bool visitIn(LIn *ins);
bool visitInArray(LInArray *ins);
bool visitInstanceOfO(LInstanceOfO *ins);

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

@ -13,7 +13,7 @@ namespace js {
namespace ion {
inline unsigned
StartArgSlot(RawScript script, JSFunction *fun)
StartArgSlot(JSScript *script, JSFunction *fun)
{
// First slot is for scope chain.
// Second one may be for arguments object.
@ -21,7 +21,7 @@ StartArgSlot(RawScript script, JSFunction *fun)
}
inline unsigned
CountArgSlots(RawScript script, JSFunction *fun)
CountArgSlots(JSScript *script, JSFunction *fun)
{
return StartArgSlot(script, fun) + (fun ? fun->nargs + 1 : 0);
}
@ -39,7 +39,7 @@ enum ExecutionMode {
class CompileInfo
{
public:
CompileInfo(RawScript script, JSFunction *fun, jsbytecode *osrPc, bool constructing,
CompileInfo(JSScript *script, JSFunction *fun, jsbytecode *osrPc, bool constructing,
ExecutionMode executionMode)
: script_(script), fun_(fun), osrPc_(osrPc), constructing_(constructing),
executionMode_(executionMode)
@ -63,7 +63,7 @@ class CompileInfo
nslots_ = nlocals_ + nstack_;
}
RawScript script() const {
JSScript *script() const {
return script_;
}
JSFunction *fun() const {

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

@ -11,7 +11,7 @@ namespace js {
namespace ion {
static inline bool
HasIonScript(RawScript script, ExecutionMode cmode)
HasIonScript(JSScript *script, ExecutionMode cmode)
{
switch (cmode) {
case SequentialExecution: return script->hasIonScript();
@ -22,7 +22,7 @@ HasIonScript(RawScript script, ExecutionMode cmode)
}
static inline IonScript *
GetIonScript(RawScript script, ExecutionMode cmode)
GetIonScript(JSScript *script, ExecutionMode cmode)
{
switch (cmode) {
case SequentialExecution: return script->maybeIonScript();
@ -33,7 +33,7 @@ GetIonScript(RawScript script, ExecutionMode cmode)
}
static inline void
SetIonScript(RawScript script, ExecutionMode cmode, IonScript *ionScript)
SetIonScript(JSScript *script, ExecutionMode cmode, IonScript *ionScript)
{
switch (cmode) {
case SequentialExecution: script->setIonScript(ionScript); return;
@ -53,7 +53,7 @@ OffsetOfIonInJSScript(ExecutionMode cmode)
}
static inline bool
CanIonCompile(RawScript script, ExecutionMode cmode)
CanIonCompile(JSScript *script, ExecutionMode cmode)
{
switch (cmode) {
case SequentialExecution: return script->canIonCompile();
@ -64,13 +64,13 @@ CanIonCompile(RawScript script, ExecutionMode cmode)
}
static inline bool
CanIonCompile(RawFunction fun, ExecutionMode cmode)
CanIonCompile(JSFunction *fun, ExecutionMode cmode)
{
return fun->isInterpreted() && CanIonCompile(fun->nonLazyScript(), cmode);
}
static inline bool
CompilingOffThread(RawScript script, ExecutionMode cmode)
CompilingOffThread(JSScript *script, ExecutionMode cmode)
{
switch (cmode) {
case SequentialExecution: return script->isIonCompilingOffThread();

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

@ -609,8 +609,8 @@ IonScript::New(JSContext *cx, uint32_t frameSlots, uint32_t frameSize, size_t sn
size_t paddedCacheEntriesSize = AlignBytes(cacheEntries * sizeof(uint32_t), DataAlignment);
size_t paddedRuntimeSize = AlignBytes(runtimeSize, DataAlignment);
size_t paddedSafepointSize = AlignBytes(safepointsSize, DataAlignment);
size_t paddedScriptSize = AlignBytes(scriptEntries * sizeof(RawScript), DataAlignment);
size_t paddedCallTargetSize = AlignBytes(callTargetEntries * sizeof(RawScript), DataAlignment);
size_t paddedScriptSize = AlignBytes(scriptEntries * sizeof(JSScript *), DataAlignment);
size_t paddedCallTargetSize = AlignBytes(callTargetEntries * sizeof(JSScript *), DataAlignment);
size_t bytes = paddedSnapshotsSize +
paddedBailoutSize +
paddedConstantsSize +
@ -904,7 +904,7 @@ ion::ToggleBarriers(JS::Zone *zone, bool needs)
AutoFlushCache afc("ToggleBarriers", zone->rt->ionRuntime());
for (gc::CellIterUnderGC i(zone, gc::FINALIZE_SCRIPT); !i.done(); i.next()) {
RawScript script = i.get<JSScript>();
JSScript *script = i.get<JSScript>();
if (script->hasIonScript())
script->ionScript()->toggleBarriers(needs);
if (script->hasBaselineScript())
@ -1241,7 +1241,7 @@ public:
return SequentialExecution;
}
MethodStatus checkScriptSize(JSContext *cx, RawScript script);
MethodStatus checkScriptSize(JSContext *cx, JSScript *script);
AbortReason compile(IonBuilder *builder, MIRGraph *graph,
ScopedJSDeletePtr<LifoAlloc> &autoDelete);
};
@ -1473,7 +1473,7 @@ CheckFrame(AbstractFramePtr fp)
}
static bool
CheckScript(RawScript script, bool osr)
CheckScript(JSScript *script, bool osr)
{
if (osr && script->needsArgsObj()) {
// OSR-ing into functions with arguments objects is not supported.
@ -1490,7 +1490,7 @@ CheckScript(RawScript script, bool osr)
}
MethodStatus
SequentialCompileContext::checkScriptSize(JSContext *cx, RawScript script)
SequentialCompileContext::checkScriptSize(JSContext *cx, JSScript *script)
{
if (!js_IonOptions.limitScriptSize)
return Method_Compiled;
@ -1742,7 +1742,7 @@ ion::CompileFunctionForBaseline(JSContext *cx, HandleScript script, AbstractFram
}
MethodStatus
ParallelCompileContext::checkScriptSize(JSContext *cx, RawScript script)
ParallelCompileContext::checkScriptSize(JSContext *cx, JSScript *script)
{
if (!js_IonOptions.limitScriptSize)
return Method_Compiled;
@ -2155,7 +2155,7 @@ InvalidateActivation(FreeOp *fop, uint8_t *ionTop, bool invalidateAll)
const char *type = it.isOptimizedJS() ? "Optimized" : "Baseline";
IonSpew(IonSpew_Invalidate, "#%d %s JS frame @ %p, %s:%d (fun: %p, script: %p, pc %p)",
frameno, type, it.fp(), it.script()->filename(), it.script()->lineno,
it.maybeCallee(), (RawScript)it.script(), it.returnAddressToFp());
it.maybeCallee(), (JSScript *)it.script(), it.returnAddressToFp());
break;
}
case IonFrame_BaselineStub:
@ -2187,7 +2187,7 @@ InvalidateActivation(FreeOp *fop, uint8_t *ionTop, bool invalidateAll)
if (it.checkInvalidation())
continue;
RawScript script = it.script();
JSScript *script = it.script();
if (!script->hasIonScript())
continue;
@ -2333,7 +2333,7 @@ ion::Invalidate(types::TypeCompartment &types, FreeOp *fop,
break;
}
JS_ASSERT(co.isValid());
RawScript script = co.script;
JSScript *script = co.script;
IonScript *ionScript = GetIonScript(script, executionMode);
Zone *zone = script->zone();
@ -2372,7 +2372,7 @@ ion::Invalidate(JSContext *cx, const Vector<types::RecompileInfo> &invalid, bool
}
bool
ion::Invalidate(JSContext *cx, RawScript script, ExecutionMode mode, bool resetUses)
ion::Invalidate(JSContext *cx, JSScript *script, ExecutionMode mode, bool resetUses)
{
JS_ASSERT(script->hasIonScript());
@ -2396,13 +2396,13 @@ ion::Invalidate(JSContext *cx, RawScript script, ExecutionMode mode, bool resetU
}
bool
ion::Invalidate(JSContext *cx, RawScript script, bool resetUses)
ion::Invalidate(JSContext *cx, JSScript *script, bool resetUses)
{
return Invalidate(cx, script, SequentialExecution, resetUses);
}
static void
FinishInvalidationOf(FreeOp *fop, RawScript script, IonScript *ionScript, bool parallel)
FinishInvalidationOf(FreeOp *fop, JSScript *script, IonScript *ionScript, bool parallel)
{
// If this script has Ion code on the stack, invalidation() will return
// true. In this case we have to wait until destroying it.
@ -2422,7 +2422,7 @@ FinishInvalidationOf(FreeOp *fop, RawScript script, IonScript *ionScript, bool p
}
void
ion::FinishInvalidation(FreeOp *fop, RawScript script)
ion::FinishInvalidation(FreeOp *fop, JSScript *script)
{
if (script->hasIonScript())
FinishInvalidationOf(fop, script, script->ionScript(), false);
@ -2444,13 +2444,13 @@ ion::MarkShapeFromIon(JSRuntime *rt, Shape **shapep)
}
void
ion::ForbidCompilation(JSContext *cx, RawScript script)
ion::ForbidCompilation(JSContext *cx, JSScript *script)
{
ForbidCompilation(cx, script, SequentialExecution);
}
void
ion::ForbidCompilation(JSContext *cx, RawScript script, ExecutionMode mode)
ion::ForbidCompilation(JSContext *cx, JSScript *script, ExecutionMode mode)
{
IonSpew(IonSpew_Abort, "Disabling Ion mode %d compilation of script %s:%d",
mode, script->filename(), script->lineno);
@ -2486,7 +2486,7 @@ ion::ForbidCompilation(JSContext *cx, RawScript script, ExecutionMode mode)
}
uint32_t
ion::UsesBeforeIonRecompile(RawScript script, jsbytecode *pc)
ion::UsesBeforeIonRecompile(JSScript *script, jsbytecode *pc)
{
JS_ASSERT(pc == script->code || JSOp(*pc) == JSOP_LOOPENTRY);
@ -2564,7 +2564,7 @@ AutoFlushInhibitor::~AutoFlushInhibitor()
int js::ion::LabelBase::id_count = 0;
void
ion::PurgeCaches(RawScript script, Zone *zone)
ion::PurgeCaches(JSScript *script, Zone *zone)
{
if (script->hasIonScript())
script->ionScript()->purgeCaches(zone);
@ -2574,7 +2574,7 @@ ion::PurgeCaches(RawScript script, Zone *zone)
}
size_t
ion::SizeOfIonData(RawScript script, JSMallocSizeOfFun mallocSizeOf)
ion::SizeOfIonData(JSScript *script, JSMallocSizeOfFun mallocSizeOf)
{
size_t result = 0;
@ -2588,7 +2588,7 @@ ion::SizeOfIonData(RawScript script, JSMallocSizeOfFun mallocSizeOf)
}
void
ion::DestroyIonScripts(FreeOp *fop, RawScript script)
ion::DestroyIonScripts(FreeOp *fop, JSScript *script)
{
if (script->hasIonScript())
ion::IonScript::Destroy(fop, script->ionScript());
@ -2601,7 +2601,7 @@ ion::DestroyIonScripts(FreeOp *fop, RawScript script)
}
void
ion::TraceIonScripts(JSTracer* trc, RawScript script)
ion::TraceIonScripts(JSTracer* trc, JSScript *script)
{
if (script->hasIonScript())
ion::IonScript::Trace(trc, script->ionScript());

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

@ -318,8 +318,8 @@ IonExecStatus FastInvoke(JSContext *cx, HandleFunction fun, CallArgsList &args);
void Invalidate(types::TypeCompartment &types, FreeOp *fop,
const Vector<types::RecompileInfo> &invalid, bool resetUses = true);
void Invalidate(JSContext *cx, const Vector<types::RecompileInfo> &invalid, bool resetUses = true);
bool Invalidate(JSContext *cx, RawScript script, ExecutionMode mode, bool resetUses = true);
bool Invalidate(JSContext *cx, RawScript script, bool resetUses = true);
bool Invalidate(JSContext *cx, JSScript *script, ExecutionMode mode, bool resetUses = true);
bool Invalidate(JSContext *cx, JSScript *script, bool resetUses = true);
void MarkValueFromIon(JSRuntime *rt, Value *vp);
void MarkShapeFromIon(JSRuntime *rt, Shape **shapep);
@ -344,14 +344,14 @@ static inline bool IsEnabled(JSContext *cx)
return cx->hasOption(JSOPTION_ION) && cx->typeInferenceEnabled();
}
void ForbidCompilation(JSContext *cx, RawScript script);
void ForbidCompilation(JSContext *cx, RawScript script, ExecutionMode mode);
uint32_t UsesBeforeIonRecompile(RawScript script, jsbytecode *pc);
void ForbidCompilation(JSContext *cx, JSScript *script);
void ForbidCompilation(JSContext *cx, JSScript *script, ExecutionMode mode);
uint32_t UsesBeforeIonRecompile(JSScript *script, jsbytecode *pc);
void PurgeCaches(RawScript script, JS::Zone *zone);
size_t SizeOfIonData(RawScript script, JSMallocSizeOfFun mallocSizeOf);
void DestroyIonScripts(FreeOp *fop, RawScript script);
void TraceIonScripts(JSTracer* trc, RawScript script);
void PurgeCaches(JSScript *script, JS::Zone *zone);
size_t SizeOfIonData(JSScript *script, JSMallocSizeOfFun mallocSizeOf);
void DestroyIonScripts(FreeOp *fop, JSScript *script);
void TraceIonScripts(JSTracer* trc, JSScript *script);
} // namespace ion
} // namespace js

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

@ -151,7 +151,7 @@ IonBuilder::getSingleCallTarget(types::StackTypeSet *calleeTypes)
if (!calleeTypes)
return NULL;
RawObject obj = calleeTypes->getSingleton();
JSObject *obj = calleeTypes->getSingleton();
if (!obj || !obj->isFunction())
return NULL;
@ -4323,6 +4323,9 @@ IonBuilder::createThisScriptedSingleton(HandleFunction target, MDefinition *call
if (!proto)
return NULL;
if (!target->nonLazyScript()->types)
return NULL;
// Generate an inline path to create a new |this| object with
// the given singleton prototype.
types::TypeObject *type = proto->getNewType(cx, &ObjectClass, target);
@ -6766,7 +6769,7 @@ GetDefiniteSlot(JSContext *cx, types::StackTypeSet *types, JSAtom *atom)
if (!type || type->unknownProperties())
return NULL;
RawId id = AtomToId(atom);
jsid id = AtomToId(atom);
if (id != types::IdToTypeId(id))
return NULL;
@ -6959,7 +6962,7 @@ IonBuilder::TestCommonPropFunc(JSContext *cx, types::StackTypeSet *types, Handle
if (obj != foundProto) {
// Walk the prototype chain. Everyone has to have the property, since we
// just checked, so propSet cannot be NULL.
RawId typeId = types::IdToTypeId(id);
jsid typeId = types::IdToTypeId(id);
while (true) {
types::HeapTypeSet *propSet = curType->getProperty(cx, typeId, false);
// This assert is now assured, since we have faulted them in
@ -7100,7 +7103,7 @@ IonBuilder::invalidatedIdempotentCache()
}
bool
IonBuilder::loadSlot(MDefinition *obj, RawShape shape, MIRType rvalType,
IonBuilder::loadSlot(MDefinition *obj, Shape *shape, MIRType rvalType,
bool barrier, types::StackTypeSet *types)
{
JS_ASSERT(shape->hasDefaultGetter());
@ -7127,7 +7130,7 @@ IonBuilder::loadSlot(MDefinition *obj, RawShape shape, MIRType rvalType,
}
bool
IonBuilder::storeSlot(MDefinition *obj, RawShape shape, MDefinition *value, bool needsBarrier)
IonBuilder::storeSlot(MDefinition *obj, Shape *shape, MDefinition *value, bool needsBarrier)
{
JS_ASSERT(shape->hasDefaultSetter());
JS_ASSERT(shape->writable());
@ -7368,7 +7371,7 @@ IonBuilder::getPropTryInlineAccess(bool *emitted, HandlePropertyName name, Handl
return true;
Vector<Shape *> shapes(cx);
if (RawShape objShape = mjit::GetPICSingleShape(cx, script(), pc, info().constructing())) {
if (Shape *objShape = mjit::GetPICSingleShape(cx, script(), pc, info().constructing())) {
if (!shapes.append(objShape))
return false;
} else {
@ -7389,10 +7392,10 @@ IonBuilder::getPropTryInlineAccess(bool *emitted, HandlePropertyName name, Handl
// instructions.
spew("Inlining monomorphic GETPROP");
RawShape objShape = shapes[0];
Shape *objShape = shapes[0];
obj = addShapeGuard(obj, objShape, Bailout_CachedShapeGuard);
RawShape shape = objShape->search(cx, id);
Shape *shape = objShape->search(cx, id);
JS_ASSERT(shape);
if (!loadSlot(obj, shape, rvalType, barrier, types))
@ -7406,8 +7409,8 @@ IonBuilder::getPropTryInlineAccess(bool *emitted, HandlePropertyName name, Handl
current->push(load);
for (size_t i = 0; i < shapes.length(); i++) {
RawShape objShape = shapes[i];
RawShape shape = objShape->search(cx, id);
Shape *objShape = shapes[i];
Shape *shape = objShape->search(cx, id);
JS_ASSERT(shape);
if (!load->addShape(objShape, shape))
return false;
@ -7568,7 +7571,7 @@ IonBuilder::jsop_setprop(HandlePropertyName name)
}
Vector<Shape *> shapes(cx);
if (RawShape objShape = mjit::GetPICSingleShape(cx, script(), pc, info().constructing())) {
if (Shape *objShape = mjit::GetPICSingleShape(cx, script(), pc, info().constructing())) {
if (!shapes.append(objShape))
return false;
} else {
@ -7584,10 +7587,10 @@ IonBuilder::jsop_setprop(HandlePropertyName name)
// long as the shape is not in dictionary mode. We cannot be sure
// that the shape is still a lastProperty, and calling Shape::search
// on dictionary mode shapes that aren't lastProperty is invalid.
RawShape objShape = shapes[0];
Shape *objShape = shapes[0];
obj = addShapeGuard(obj, objShape, Bailout_CachedShapeGuard);
RawShape shape = objShape->search(cx, NameToId(name));
Shape *shape = objShape->search(cx, NameToId(name));
JS_ASSERT(shape);
bool needsBarrier = objTypes->propertyNeedsBarrier(cx, id);
@ -7601,8 +7604,8 @@ IonBuilder::jsop_setprop(HandlePropertyName name)
current->push(value);
for (size_t i = 0; i < shapes.length(); i++) {
RawShape objShape = shapes[i];
RawShape shape = objShape->search(cx, id);
Shape *objShape = shapes[i];
Shape *shape = objShape->search(cx, id);
JS_ASSERT(shape);
if (!ins->addShape(objShape, shape))
return false;
@ -7965,7 +7968,7 @@ IonBuilder::jsop_instanceof()
// exact function and prototype object being tested for, use a typed path.
do {
types::StackTypeSet *rhsTypes = rhs->resultTypeSet();
RawObject rhsObject = rhsTypes ? rhsTypes->getSingleton() : NULL;
JSObject *rhsObject = rhsTypes ? rhsTypes->getSingleton() : NULL;
if (!rhsObject || !rhsObject->isFunction() || rhsObject->isBoundFunction())
break;
@ -7975,7 +7978,7 @@ IonBuilder::jsop_instanceof()
types::HeapTypeSet *protoTypes =
rhsType->getProperty(cx, NameToId(cx->names().classPrototype), false);
RawObject protoObject = protoTypes ? protoTypes->getSingleton(cx) : NULL;
JSObject *protoObject = protoTypes ? protoTypes->getSingleton(cx) : NULL;
if (!protoObject)
break;
@ -8017,7 +8020,7 @@ IonBuilder::addBoundsCheck(MDefinition *index, MDefinition *length)
}
MInstruction *
IonBuilder::addShapeGuard(MDefinition *obj, const RawShape shape, BailoutKind bailoutKind)
IonBuilder::addShapeGuard(MDefinition *obj, Shape *const shape, BailoutKind bailoutKind)
{
MGuardShape *guard = MGuardShape::New(obj, shape, bailoutKind);
current->add(guard);

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

@ -321,7 +321,7 @@ class IonBuilder : public MIRGenerator
MInstruction *addConvertElementsToDoubles(MDefinition *elements);
MInstruction *addBoundsCheck(MDefinition *index, MDefinition *length);
MInstruction *addShapeGuard(MDefinition *obj, const RawShape shape, BailoutKind bailoutKind);
MInstruction *addShapeGuard(MDefinition *obj, Shape *const shape, BailoutKind bailoutKind);
JSObject *getNewArrayTemplateObject(uint32_t count);
MDefinition *convertShiftToMaskForStaticTypedArray(MDefinition *id,
@ -329,9 +329,9 @@ class IonBuilder : public MIRGenerator
bool invalidatedIdempotentCache();
bool loadSlot(MDefinition *obj, RawShape shape, MIRType rvalType,
bool loadSlot(MDefinition *obj, Shape *shape, MIRType rvalType,
bool barrier, types::StackTypeSet *types);
bool storeSlot(MDefinition *obj, RawShape shape, MDefinition *value, bool needsBarrier);
bool storeSlot(MDefinition *obj, Shape *shape, MDefinition *value, bool needsBarrier);
// jsop_getprop() helpers.
bool getPropTryArgumentsLength(bool *emitted);

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

@ -481,7 +481,7 @@ IsCacheableProtoChain(JSObject *obj, JSObject *holder)
}
static bool
IsCacheableGetPropReadSlot(JSObject *obj, JSObject *holder, RawShape shape)
IsCacheableGetPropReadSlot(JSObject *obj, JSObject *holder, Shape *shape)
{
if (!shape || !IsCacheableProtoChain(obj, holder))
return false;
@ -493,7 +493,7 @@ IsCacheableGetPropReadSlot(JSObject *obj, JSObject *holder, RawShape shape)
}
static bool
IsCacheableNoProperty(JSObject *obj, JSObject *holder, RawShape shape, jsbytecode *pc,
IsCacheableNoProperty(JSObject *obj, JSObject *holder, Shape *shape, jsbytecode *pc,
const TypedOrValueRegister &output)
{
if (shape)
@ -544,7 +544,7 @@ IsCacheableNoProperty(JSObject *obj, JSObject *holder, RawShape shape, jsbytecod
}
static bool
IsCacheableGetPropCallNative(JSObject *obj, JSObject *holder, RawShape shape)
IsCacheableGetPropCallNative(JSObject *obj, JSObject *holder, Shape *shape)
{
if (!shape || !IsCacheableProtoChain(obj, holder))
return false;
@ -557,7 +557,7 @@ IsCacheableGetPropCallNative(JSObject *obj, JSObject *holder, RawShape shape)
}
static bool
IsCacheableGetPropCallPropertyOp(JSObject *obj, JSObject *holder, RawShape shape)
IsCacheableGetPropCallPropertyOp(JSObject *obj, JSObject *holder, Shape *shape)
{
if (!shape || !IsCacheableProtoChain(obj, holder))
return false;
@ -1688,7 +1688,7 @@ SetPropertyIC::attachNativeAdding(JSContext *cx, IonScript *ion, JSObject *obj,
JSObject *proto = obj->getProto();
Register protoReg = object();
while (proto) {
RawShape protoShape = proto->lastProperty();
Shape *protoShape = proto->lastProperty();
// load next prototype
masm.loadPtr(Address(protoReg, JSObject::offsetOfType()), protoReg);
@ -1749,7 +1749,7 @@ IsPropertyInlineable(JSObject *obj)
static bool
IsPropertySetInlineable(JSContext *cx, HandleObject obj, HandleId id, MutableHandleShape pshape)
{
RawShape shape = obj->nativeLookup(cx, id);
Shape *shape = obj->nativeLookup(cx, id);
if (!shape)
return false;
@ -1823,7 +1823,7 @@ IsPropertyAddInlineable(JSContext *cx, HandleObject obj, HandleId id, uint32_t o
return false;
// if prototype defines this property in a non-plain way, don't optimize
RawShape protoShape = proto->nativeLookup(cx, id);
Shape *protoShape = proto->nativeLookup(cx, id);
if (protoShape && !protoShape->hasDefaultSetter())
return false;
@ -2216,7 +2216,7 @@ BindNameIC::attachGlobal(JSContext *cx, IonScript *ion, JSObject *scopeChain)
static inline void
GenerateScopeChainGuard(MacroAssembler &masm, JSObject *scopeObj,
Register scopeObjReg, RawShape shape, Label *failures)
Register scopeObjReg, Shape *shape, Label *failures)
{
if (scopeObj->isCall()) {
// We can skip a guard on the call object if the script's bindings are
@ -2224,8 +2224,8 @@ GenerateScopeChainGuard(MacroAssembler &masm, JSObject *scopeObj,
// variables).
CallObject *callObj = &scopeObj->asCall();
if (!callObj->isForEval()) {
RawFunction fun = &callObj->callee();
RawScript script = fun->nonLazyScript();
JSFunction *fun = &callObj->callee();
JSScript *script = fun->nonLazyScript();
if (!script->funHasExtensibleScope)
return;
}
@ -2452,7 +2452,7 @@ NameIC::attachCallGetter(JSContext *cx, IonScript *ion, JSObject *obj, JSObject
}
static bool
IsCacheableNameCallGetter(JSObject *scopeChain, JSObject *obj, JSObject *holder, RawShape shape)
IsCacheableNameCallGetter(JSObject *scopeChain, JSObject *obj, JSObject *holder, Shape *shape)
{
if (obj != scopeChain)
return false;

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

@ -251,7 +251,7 @@ class IonCache
idempotent_ = true;
}
void setScriptedLocation(RawScript script, jsbytecode *pc) {
void setScriptedLocation(JSScript *script, jsbytecode *pc) {
JS_ASSERT(!idempotent_);
this->script = script;
this->pc = pc;

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

@ -381,7 +381,7 @@ struct IonScript
size_t safepointsSize() const {
return safepointsSize_;
}
RawScript getScript(size_t i) const {
JSScript *getScript(size_t i) const {
JS_ASSERT(i < scriptEntries_);
return scriptList()[i];
}

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

@ -389,7 +389,7 @@ class IonActivation
// Called from JSCompartment::discardJitCode().
void InvalidateAll(FreeOp *fop, JS::Zone *zone);
void FinishInvalidation(FreeOp *fop, RawScript script);
void FinishInvalidation(FreeOp *fop, JSScript *script);
} // namespace ion
} // namespace js

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

@ -19,7 +19,7 @@ template <class Op>
inline void
SnapshotIterator::readFrameArgs(Op &op, const Value *argv, Value *scopeChain, Value *thisv,
unsigned start, unsigned formalEnd, unsigned iterEnd,
RawScript script)
JSScript *script)
{
if (scopeChain)
*scopeChain = read();

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

@ -153,7 +153,7 @@ class IonFrameIterator
JSFunction *callee() const;
JSFunction *maybeCallee() const;
unsigned numActualArgs() const;
RawScript script() const;
JSScript *script() const;
void baselineScriptAndPc(JSScript **scriptRes, jsbytecode **pcRes) const;
Value *nativeVp() const;
Value *actualArgs() const;
@ -270,7 +270,7 @@ class SnapshotIterator : public SnapshotReader
template <class Op>
inline void readFrameArgs(Op &op, const Value *argv, Value *scopeChain, Value *thisv,
unsigned start, unsigned formalEnd, unsigned iterEnd,
RawScript script);
JSScript *script);
Value maybeReadSlotByIndex(size_t index) {
while (index--) {
@ -324,7 +324,7 @@ class InlineFrameIteratorMaybeGC
template <class Op>
inline void forEachCanonicalActualArg(JSContext *cx, Op op, unsigned start, unsigned count) const;
RawScript script() const {
JSScript *script() const {
return script_;
}
jsbytecode *pc() const {

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

@ -101,7 +101,7 @@ IonFrameIterator::frameSize() const
}
// Returns the JSScript associated with the topmost Ion frame.
inline RawScript
inline JSScript *
GetTopIonJSScript(PerThreadData *pt, const SafepointIndex **safepointIndexOut, void **returnAddrOut)
{
IonFrameIterator iter(pt->ionTop);
@ -126,7 +126,7 @@ GetTopIonJSScript(PerThreadData *pt, const SafepointIndex **safepointIndexOut, v
}
inline RawScript
inline JSScript *
GetTopIonJSScript(JSContext *cx, const SafepointIndex **safepointIndexOut, void **returnAddrOut)
{
return GetTopIonJSScript(&cx->mainThread(), safepointIndexOut, returnAddrOut);

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

@ -59,7 +59,7 @@ bool
IonFrameIterator::checkInvalidation(IonScript **ionScriptOut) const
{
uint8_t *returnAddr = returnAddressToFp();
RawScript script = this->script();
JSScript *script = this->script();
// N.B. the current IonScript is not the same as the frame's
// IonScript if the frame has since been invalidated.
bool invalidated;
@ -174,13 +174,13 @@ IonFrameIterator::isEntryJSFrame() const
return true;
}
RawScript
JSScript *
IonFrameIterator::script() const
{
JS_ASSERT(isScripted());
if (isBaselineJS())
return baselineFrame()->script();
RawScript script = ScriptFromCalleeToken(calleeToken());
JSScript *script = ScriptFromCalleeToken(calleeToken());
JS_ASSERT(script);
return script;
}
@ -189,7 +189,7 @@ void
IonFrameIterator::baselineScriptAndPc(JSScript **scriptRes, jsbytecode **pcRes) const
{
JS_ASSERT(isBaselineJS());
RawScript script = this->script();
JSScript *script = this->script();
if (scriptRes)
*scriptRes = script;
uint8_t *retAddr = returnAddressToFp();
@ -474,7 +474,7 @@ HandleException(ResumeFromException *rfe)
// When profiling, each frame popped needs a notification that
// the function has exited, so invoke the probe that a function
// is exiting.
RawScript script = frames.script();
JSScript *script = frames.script();
Probes::exitScript(cx, script, script->function(), NULL);
if (!frames.more())
break;
@ -494,7 +494,7 @@ HandleException(ResumeFromException *rfe)
return;
// Unwind profiler pseudo-stack
RawScript script = iter.script();
JSScript *script = iter.script();
Probes::exitScript(cx, script, script->function(), NULL);
if (cx->compartment->debugMode() && !calledDebugEpilogue) {
@ -633,7 +633,7 @@ MarkCalleeToken(JSTracer *trc, CalleeToken token)
}
case CalleeToken_Script:
{
RawScript script = CalleeTokenToScript(token);
JSScript *script = CalleeTokenToScript(token);
MarkScriptRoot(trc, &script, "ion-entry");
JS_ASSERT(script == CalleeTokenToScript(token));
break;

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

@ -49,7 +49,7 @@ CalleeToParallelToken(JSFunction *fun)
return CalleeToken(uintptr_t(fun) | uintptr_t(CalleeToken_ParallelFunction));
}
static inline CalleeToken
CalleeToToken(RawScript script)
CalleeToToken(JSScript *script)
{
return CalleeToken(uintptr_t(script) | uintptr_t(CalleeToken_Script));
}
@ -64,20 +64,20 @@ CalleeTokenToFunction(CalleeToken token)
JS_ASSERT(CalleeTokenIsFunction(token));
return (JSFunction *)token;
}
static inline RawFunction
static inline JSFunction *
CalleeTokenToParallelFunction(CalleeToken token)
{
JS_ASSERT(GetCalleeTokenTag(token) == CalleeToken_ParallelFunction);
return (JSFunction *)(uintptr_t(token) & ~uintptr_t(0x3));
}
static inline RawScript
static inline JSScript *
CalleeTokenToScript(CalleeToken token)
{
JS_ASSERT(GetCalleeTokenTag(token) == CalleeToken_Script);
return (RawScript)(uintptr_t(token) & ~uintptr_t(0x3));
return (JSScript *)(uintptr_t(token) & ~uintptr_t(0x3));
}
static inline RawScript
static inline JSScript *
ScriptFromCalleeToken(CalleeToken token)
{
switch (GetCalleeTokenTag(token)) {
@ -293,7 +293,7 @@ MakeFrameDescriptor(uint32_t frameSize, FrameType type)
namespace js {
namespace ion {
RawScript
JSScript *
GetTopIonJSScript(JSContext *cx,
const SafepointIndex **safepointIndexOut = NULL,
void **returnAddrOut = NULL);

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

@ -763,7 +763,7 @@ class MacroAssembler : public MacroAssemblerSpecific
bind(&stackFull);
}
void spsPushFrame(SPSProfiler *p, const char *str, RawScript s, Register temp) {
void spsPushFrame(SPSProfiler *p, const char *str, JSScript *s, Register temp) {
Label stackFull;
spsProfileEntryAddress(p, 0, temp, &stackFull);

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

@ -176,7 +176,7 @@ JSONSpewer::init(const char *path)
}
void
JSONSpewer::beginFunction(RawScript script)
JSONSpewer::beginFunction(JSScript *script)
{
if (inFunction_)
endFunction();

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

@ -60,7 +60,7 @@ class JSONSpewer
~JSONSpewer();
bool init(const char *path);
void beginFunction(RawScript script);
void beginFunction(JSScript *script);
void beginPass(const char * pass);
void spewMDef(MDefinition *def);
void spewMResumePoint(MResumePoint *rp);

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

@ -4354,7 +4354,7 @@ class LFunctionBoundary : public LInstructionHelper<0, 0, 1>
return getTemp(0);
}
RawScript script() {
JSScript *script() {
return mir_->toFunctionBoundary()->script();
}

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

@ -1097,7 +1097,7 @@ IonBuilder::inlineNewParallelArray(CallInfo &callInfo)
return InliningStatus_NotInlined;
types::StackTypeSet *ctorTypes = callInfo.getArg(0)->resultTypeSet();
RawObject targetObj = ctorTypes ? ctorTypes->getSingleton() : NULL;
JSObject *targetObj = ctorTypes ? ctorTypes->getSingleton() : NULL;
RootedFunction target(cx);
if (targetObj && targetObj->isFunction())
target = targetObj->toFunction();

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

@ -395,7 +395,7 @@ MConstant::printOpcode(FILE *fp)
fputs("unnamed function", fp);
}
if (fun->hasScript()) {
RawScript script = fun->nonLazyScript();
JSScript *script = fun->nonLazyScript();
fprintf(fp, " (%s:%u)",
script->filename() ? script->filename() : "", script->lineno);
}
@ -2244,7 +2244,7 @@ MGetPropertyPolymorphic::mightAlias(MDefinition *store)
return true;
for (size_t i = 0; i < numShapes(); i++) {
RawShape shape = this->shape(i);
Shape *shape = this->shape(i);
if (shape->slot() < shape->numFixedSlots()) {
// Fixed slot.
uint32_t slot = shape->slot();

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

@ -5373,10 +5373,10 @@ class MGetPropertyPolymorphic
{
struct Entry {
// The shape to guard against.
RawShape objShape;
Shape *objShape;
// The property to laod.
RawShape shape;
Shape *shape;
};
Vector<Entry, 4, IonAllocPolicy> shapes_;
@ -5412,7 +5412,7 @@ class MGetPropertyPolymorphic
TypePolicy *typePolicy() {
return this;
}
bool addShape(RawShape objShape, RawShape shape) {
bool addShape(Shape *objShape, Shape *shape) {
Entry entry;
entry.objShape = objShape;
entry.shape = shape;
@ -5421,10 +5421,10 @@ class MGetPropertyPolymorphic
size_t numShapes() const {
return shapes_.length();
}
RawShape objShape(size_t i) const {
Shape *objShape(size_t i) const {
return shapes_[i].objShape;
}
RawShape shape(size_t i) const {
Shape *shape(size_t i) const {
return shapes_[i].shape;
}
MDefinition *obj() const {
@ -5445,10 +5445,10 @@ class MSetPropertyPolymorphic
{
struct Entry {
// The shape to guard against.
RawShape objShape;
Shape *objShape;
// The property to laod.
RawShape shape;
Shape *shape;
};
Vector<Entry, 4, IonAllocPolicy> shapes_;
@ -5470,7 +5470,7 @@ class MSetPropertyPolymorphic
TypePolicy *typePolicy() {
return this;
}
bool addShape(RawShape objShape, RawShape shape) {
bool addShape(Shape *objShape, Shape *shape) {
Entry entry;
entry.objShape = objShape;
entry.shape = shape;
@ -5479,10 +5479,10 @@ class MSetPropertyPolymorphic
size_t numShapes() const {
return shapes_.length();
}
RawShape objShape(size_t i) const {
Shape *objShape(size_t i) const {
return shapes_[i].objShape;
}
RawShape shape(size_t i) const {
Shape *shape(size_t i) const {
return shapes_[i].shape;
}
MDefinition *obj() const {
@ -5849,7 +5849,7 @@ class MBindNameCache
CompilerRootScript script_;
jsbytecode *pc_;
MBindNameCache(MDefinition *scopeChain, PropertyName *name, RawScript script, jsbytecode *pc)
MBindNameCache(MDefinition *scopeChain, PropertyName *name, JSScript *script, jsbytecode *pc)
: MUnaryInstruction(scopeChain), name_(name), script_(script), pc_(pc)
{
setResultType(MIRType_Object);
@ -5858,7 +5858,7 @@ class MBindNameCache
public:
INSTRUCTION_HEADER(BindNameCache)
static MBindNameCache *New(MDefinition *scopeChain, PropertyName *name, RawScript script,
static MBindNameCache *New(MDefinition *scopeChain, PropertyName *name, JSScript *script,
jsbytecode *pc) {
return new MBindNameCache(scopeChain, name, script, pc);
}
@ -5872,7 +5872,7 @@ class MBindNameCache
PropertyName *name() const {
return name_;
}
RawScript script() const {
JSScript *script() const {
return script_;
}
jsbytecode *pc() const {
@ -5911,7 +5911,7 @@ class MGuardShape
MDefinition *obj() const {
return getOperand(0);
}
const RawShape shape() const {
const Shape *shape() const {
return shape_;
}
BailoutKind bailoutKind() const {
@ -6916,7 +6916,7 @@ class MInstanceOf
CompilerRootObject protoObj_;
public:
MInstanceOf(MDefinition *obj, RawObject proto)
MInstanceOf(MDefinition *obj, JSObject *proto)
: MUnaryInstruction(obj),
protoObj_(proto)
{
@ -6929,7 +6929,7 @@ class MInstanceOf
return this;
}
RawObject prototypeObject() {
JSObject *prototypeObject() {
return protoObj_;
}
};
@ -7124,7 +7124,7 @@ class MTypeBarrier
// Like MTypeBarrier, guard that the value is in the given type set. This is
// used before property writes to ensure the value being written is represented
// in the property types for the object.
class MMonitorTypes : public MUnaryInstruction
class MMonitorTypes : public MUnaryInstruction, public BoxInputsPolicy
{
const types::StackTypeSet *typeSet_;
@ -7142,6 +7142,11 @@ class MMonitorTypes : public MUnaryInstruction
static MMonitorTypes *New(MDefinition *def, const types::StackTypeSet *types) {
return new MMonitorTypes(def, types);
}
TypePolicy *typePolicy() {
return this;
}
MDefinition *input() const {
return getOperand(0);
}
@ -7329,7 +7334,7 @@ class MFunctionBoundary : public MNullaryInstruction
Type type_;
unsigned inlineLevel_;
MFunctionBoundary(RawScript script, Type type, unsigned inlineLevel)
MFunctionBoundary(JSScript *script, Type type, unsigned inlineLevel)
: script_(script), type_(type), inlineLevel_(inlineLevel)
{
JS_ASSERT_IF(type != Inline_Exit, script != NULL);
@ -7340,12 +7345,12 @@ class MFunctionBoundary : public MNullaryInstruction
public:
INSTRUCTION_HEADER(FunctionBoundary)
static MFunctionBoundary *New(RawScript script, Type type,
static MFunctionBoundary *New(JSScript *script, Type type,
unsigned inlineLevel = 0) {
return new MFunctionBoundary(script, type, inlineLevel);
}
RawScript script() {
JSScript *script() {
return script_;
}

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

@ -510,11 +510,11 @@ class MIRGraph
MStart *osrStart_;
// List of compiled/inlined scripts.
Vector<RawScript, 4, IonAllocPolicy> scripts_;
Vector<JSScript *, 4, IonAllocPolicy> scripts_;
// List of possible scripts that this graph may call. Currently this is
// only tracked when compiling for parallel execution.
Vector<RawScript, 4, IonAllocPolicy> callTargets_;
Vector<JSScript *, 4, IonAllocPolicy> callTargets_;
size_t numBlocks_;
@ -634,7 +634,7 @@ class MIRGraph
MStart *osrStart() {
return osrStart_;
}
bool addScript(RawScript script) {
bool addScript(JSScript *script) {
// The same script may be inlined multiple times, add it only once.
for (size_t i = 0; i < scripts_.length(); i++) {
if (scripts_[i] == script)
@ -648,7 +648,7 @@ class MIRGraph
JSScript **scripts() {
return scripts_.begin();
}
bool addCallTarget(RawScript script) {
bool addCallTarget(JSScript *script) {
for (size_t i = 0; i < callTargets_.length(); i++) {
if (callTargets_[i] == script)
return true;

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

@ -759,7 +759,7 @@ GetPossibleCallees(JSContext *cx, HandleScript script, jsbytecode *pc,
RootedFunction fun(cx);
for (unsigned i = 0; i < objCount; i++) {
RawObject obj = calleeTypes->getSingleObject(i);
JSObject *obj = calleeTypes->getSingleObject(i);
if (obj && obj->isFunction()) {
fun = obj->toFunction();
} else {

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

@ -47,7 +47,7 @@ class ParallelCompileContext
}
// Defined in Ion.cpp, so that they can make use of static fns defined there
MethodStatus checkScriptSize(JSContext *cx, RawScript script);
MethodStatus checkScriptSize(JSContext *cx, JSScript *script);
MethodStatus compileTransitively();
AbortReason compile(IonBuilder *builder, MIRGraph *graph,
ScopedJSDeletePtr<LifoAlloc> &autoDelete);

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

@ -19,7 +19,7 @@ struct PcScriptCacheEntry
{
uint8_t *returnAddress; // Key into the hash table.
jsbytecode *pc; // Cached PC.
RawScript script; // Cached script.
JSScript *script; // Cached script.
};
struct PcScriptCache
@ -45,7 +45,7 @@ struct PcScriptCache
bool get(JSRuntime *rt, uint32_t hash, uint8_t *addr,
JSScript **scriptRes, jsbytecode **pcRes);
void add(uint32_t hash, uint8_t *addr, jsbytecode *pc, RawScript script) {
void add(uint32_t hash, uint8_t *addr, jsbytecode *pc, JSScript *script) {
entries[hash].returnAddress = addr;
entries[hash].pc = pc;
entries[hash].script = script;

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

@ -33,7 +33,7 @@ class SnapshotWriter
public:
SnapshotOffset startSnapshot(uint32_t frameCount, BailoutKind kind, bool resumeAfter);
void startFrame(JSFunction *fun, RawScript script, jsbytecode *pc, uint32_t exprStack);
void startFrame(JSFunction *fun, JSScript *script, jsbytecode *pc, uint32_t exprStack);
#ifdef TRACK_SNAPSHOTS
void trackFrame(uint32_t pcOpcode, uint32_t mirOpcode, uint32_t mirId,
uint32_t lirOpcode, uint32_t lirId);

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

@ -30,7 +30,7 @@ using namespace js::ion;
// Snapshot body, repeated "frame count" times, from oldest frame to newest frame.
// Note that the first frame doesn't have the "parent PC" field.
//
// [ptr] Debug only: RawScript
// [ptr] Debug only: JSScript *
// [vwu] pc offset
// [vwu] # of slots, including nargs
// [slot*] N slot entries, where N = nargs + nfixed + stackDepth
@ -296,7 +296,7 @@ SnapshotWriter::startSnapshot(uint32_t frameCount, BailoutKind kind, bool resume
}
void
SnapshotWriter::startFrame(JSFunction *fun, RawScript script, jsbytecode *pc, uint32_t exprStack)
SnapshotWriter::startFrame(JSFunction *fun, JSScript *script, jsbytecode *pc, uint32_t exprStack)
{
JS_ASSERT(CountArgSlots(script, fun) < SNAPSHOT_MAX_NARGS);

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

@ -243,7 +243,7 @@ template bool StringsEqual<true>(JSContext *cx, HandleString lhs, HandleString r
template bool StringsEqual<false>(JSContext *cx, HandleString lhs, HandleString rhs, JSBool *res);
JSBool
ObjectEmulatesUndefined(RawObject obj)
ObjectEmulatesUndefined(JSObject *obj)
{
return EmulatesUndefined(obj);
}

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

@ -254,7 +254,7 @@ template <> struct TypeToArgProperties<Handle<StaticBlockObject *> > {
static const uint32_t result = TypeToArgProperties<StaticBlockObject *>::result | VMFunction::ByRef;
};
template <> struct TypeToArgProperties<HandleScript> {
static const uint32_t result = TypeToArgProperties<RawScript>::result | VMFunction::ByRef;
static const uint32_t result = TypeToArgProperties<JSScript *>::result | VMFunction::ByRef;
};
template <> struct TypeToArgProperties<HandleValue> {
static const uint32_t result = TypeToArgProperties<Value>::result | VMFunction::ByRef;
@ -491,7 +491,7 @@ bool GreaterThanOrEqual(JSContext *cx, MutableHandleValue lhs, MutableHandleValu
template<bool Equal>
bool StringsEqual(JSContext *cx, HandleString left, HandleString right, JSBool *res);
JSBool ObjectEmulatesUndefined(RawObject obj);
JSBool ObjectEmulatesUndefined(JSObject *obj);
bool IteratorMore(JSContext *cx, HandleObject obj, JSBool *res);

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

@ -109,8 +109,13 @@ class ValueNumberData : public TempObject {
// Set the class of this to the given representative value.
void setClass(MDefinition *thisDef, MDefinition *rep) {
JS_ASSERT(thisDef->valueNumberData() == this);
// If this value should already be in the given set, don't do anything
if (number == rep->valueNumber())
// If we are attempting to insert ourself, then nothing needs to be done.
// However, if the definition to be inserted already has the correct value number,
// it still needs to be inserted, since the value number needs to be updated lazily.
// this updating tactic can leave the world in a state where thisDef is not in the
// equivalence class of rep, but it has the same value number. Defs in this state
// need to be re-processed.
if (this == rep->valueNumberData())
return;
if (classNext)

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

@ -374,14 +374,14 @@ class OutOfLineCode : public TempObject
uint32_t framePushed() const {
return framePushed_;
}
void setSource(RawScript script, jsbytecode *pc) {
void setSource(JSScript *script, jsbytecode *pc) {
script_ = script;
pc_ = pc;
}
jsbytecode *pc() {
return pc_;
}
RawScript script() {
JSScript *script() {
return script_;
}
};

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

@ -0,0 +1,34 @@
assertEq((function() {
'use asm';
function _main() {
var $1=0, $2=0, $3=0, $4=0, $5=0, $6=0, $7=0, $8=0, $9=0, $10=0, label=0;
label = 1;
while (1) {
switch (label | 0) {
case 1:
$2 = $1 + 14 | 0;
$3 = $1;
label = 20;
break;
case 20:
$5 = $2;
$4 = $3;
label = 24;
break;
case 24:
$7 = $5 + 1 | 0;
$8 = $4 + 1 | 0;
return $8|0;
case 49:
$9 = $6 + 1 | 0;
if ($10) {
$6 = $9;
break;
}
return 0;
}
}
return 0;
}
return _main;
})()(), 1);

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

@ -1958,7 +1958,7 @@ CrossScriptSSA::foldValue(const CrossSSAValue &cv)
const Frame &frame = getFrame(cv.frame);
const SSAValue &v = cv.v;
RawScript parentScript = NULL;
JSScript *parentScript = NULL;
ScriptAnalysis *parentAnalysis = NULL;
if (frame.parent != INVALID_FRAME) {
parentScript = getFrame(frame.parent).script;
@ -1991,7 +1991,7 @@ CrossScriptSSA::foldValue(const CrossSSAValue &cv)
* If there is a single inline callee with a single return site,
* propagate back to that.
*/
RawScript callee = NULL;
JSScript *callee = NULL;
uint32_t calleeFrame = INVALID_FRAME;
for (unsigned i = 0; i < numFrames(); i++) {
if (iterFrame(i).parent == cv.frame && iterFrame(i).parentpc == pc) {

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

@ -172,7 +172,7 @@ class Bytecode
};
static inline unsigned
GetDefCount(RawScript script, unsigned offset)
GetDefCount(JSScript *script, unsigned offset)
{
JS_ASSERT(offset < script->length);
jsbytecode *pc = script->code + offset;
@ -199,7 +199,7 @@ GetDefCount(RawScript script, unsigned offset)
}
static inline unsigned
GetUseCount(RawScript script, unsigned offset)
GetUseCount(JSScript *script, unsigned offset)
{
JS_ASSERT(offset < script->length);
jsbytecode *pc = script->code + offset;
@ -326,7 +326,7 @@ NegateCompareOp(JSOp op)
}
static inline unsigned
FollowBranch(JSContext *cx, RawScript script, unsigned offset)
FollowBranch(JSContext *cx, JSScript *script, unsigned offset)
{
/*
* Get the target offset of a branch. For GOTO opcodes implementing
@ -354,18 +354,18 @@ static inline uint32_t ThisSlot() {
static inline uint32_t ArgSlot(uint32_t arg) {
return 2 + arg;
}
static inline uint32_t LocalSlot(RawScript script, uint32_t local) {
static inline uint32_t LocalSlot(JSScript *script, uint32_t local) {
return 2 + (script->function() ? script->function()->nargs : 0) + local;
}
static inline uint32_t TotalSlots(RawScript script) {
static inline uint32_t TotalSlots(JSScript *script) {
return LocalSlot(script, 0) + script->nfixed;
}
static inline uint32_t StackSlot(RawScript script, uint32_t index) {
static inline uint32_t StackSlot(JSScript *script, uint32_t index) {
return TotalSlots(script) + index;
}
static inline uint32_t GetBytecodeSlot(RawScript script, jsbytecode *pc)
static inline uint32_t GetBytecodeSlot(JSScript *script, jsbytecode *pc)
{
switch (JSOp(*pc)) {
@ -541,7 +541,7 @@ struct LifetimeVariable
}
/* Return true if the variable cannot decrease during the body of a loop. */
bool nonDecreasing(RawScript script, LoopAnalysis *loop) const {
bool nonDecreasing(JSScript *script, LoopAnalysis *loop) const {
Lifetime *segment = lifetime ? lifetime : saved;
while (segment && segment->start <= loop->backedge) {
if (segment->start >= loop->head && segment->write) {
@ -858,7 +858,7 @@ class ScriptAnalysis
public:
ScriptAnalysis(RawScript script) {
ScriptAnalysis(JSScript *script) {
mozilla::PodZero(this);
this->script_ = script;
#ifdef DEBUG
@ -1231,7 +1231,7 @@ class CrossScriptSSA
uint32_t parent;
jsbytecode *parentpc;
Frame(uint32_t index, RawScript script, uint32_t depth, uint32_t parent,
Frame(uint32_t index, JSScript *script, uint32_t depth, uint32_t parent,
jsbytecode *parentpc)
: index(index), script(script), depth(depth), parent(parent), parentpc(parentpc)
{}
@ -1250,7 +1250,7 @@ class CrossScriptSSA
return inlineFrames[i - 1];
}
RawScript outerScript() { return outerFrame.script; }
JSScript *outerScript() { return outerFrame.script; }
/* Total length of scripts preceding a frame. */
size_t frameLength(uint32_t index) {
@ -1266,14 +1266,14 @@ class CrossScriptSSA
return getFrame(cv.frame).script->analysis()->getValueTypes(cv.v);
}
bool addInlineFrame(RawScript script, uint32_t depth, uint32_t parent,
bool addInlineFrame(JSScript *script, uint32_t depth, uint32_t parent,
jsbytecode *parentpc)
{
uint32_t index = inlineFrames.length();
return inlineFrames.append(Frame(index, script, depth, parent, parentpc));
}
CrossScriptSSA(JSContext *cx, RawScript outer)
CrossScriptSSA(JSContext *cx, JSScript *outer)
: outerFrame(OUTER_FRAME, outer, 0, INVALID_FRAME, NULL), inlineFrames(cx)
{}

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

@ -59,6 +59,11 @@ template<JSObject *Create(JSContext *, uint32_t),
bool
TestPlainTypedArray(JSContext *cx)
{
{
RootedObject notArray(cx, Create(cx, UINT32_MAX));
CHECK(!notArray);
}
RootedObject array(cx, Create(cx, 7));
CHECK(JS_IsTypedArrayObject(array));
RootedObject proto(cx);
@ -95,6 +100,11 @@ TestArrayFromBuffer(JSContext *cx)
CHECK(bufdata = JS_GetArrayBufferData(buffer));
memset(bufdata, 1, nbytes);
{
RootedObject notArray(cx, CreateWithBuffer(cx, buffer, UINT32_MAX, -1));
CHECK(!notArray);
}
RootedObject array(cx, CreateWithBuffer(cx, buffer, 0, -1));
CHECK_EQUAL(JS_GetTypedArrayLength(array), elts);
CHECK_EQUAL(JS_GetTypedArrayByteOffset(array), 0);

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

@ -3235,7 +3235,7 @@ JS_LinkConstructorAndPrototype(JSContext *cx, JSObject *ctorArg, JSObject *proto
}
JS_PUBLIC_API(JSClass *)
JS_GetClass(RawObject obj)
JS_GetClass(JSObject *obj)
{
return obj->getJSClass();
}
@ -3271,14 +3271,14 @@ JS_HasInstance(JSContext *cx, JSObject *objArg, jsval valueArg, JSBool *bp)
}
JS_PUBLIC_API(void *)
JS_GetPrivate(RawObject obj)
JS_GetPrivate(JSObject *obj)
{
/* This function can be called by a finalizer. */
return obj->getPrivate();
}
JS_PUBLIC_API(void)
JS_SetPrivate(RawObject obj, void *data)
JS_SetPrivate(JSObject *obj, void *data)
{
/* This function can be called by a finalizer. */
obj->setPrivate(data);
@ -3316,7 +3316,7 @@ JS_SetPrototype(JSContext *cx, JSObject *objArg, JSObject *protoArg)
}
JS_PUBLIC_API(JSObject *)
JS_GetParent(RawObject obj)
JS_GetParent(JSObject *obj)
{
JS_ASSERT(!obj->isScope());
return obj->getParent();
@ -4490,7 +4490,7 @@ JS_DeleteProperty(JSContext *cx, JSObject *objArg, const char *name)
return JS_DeleteProperty2(cx, objArg, name, &junk);
}
static RawShape
static Shape *
LastConfigurableShape(JSObject *obj)
{
for (Shape::Range<NoGC> r(obj->lastProperty()); !r.empty(); r.popFront()) {
@ -4577,7 +4577,7 @@ JS_Enumerate(JSContext *cx, JSObject *objArg)
const uint32_t JSSLOT_ITER_INDEX = 0;
static void
prop_iter_finalize(FreeOp *fop, RawObject obj)
prop_iter_finalize(FreeOp *fop, JSObject *obj)
{
void *pdata = obj->getPrivate();
if (!pdata)
@ -4591,7 +4591,7 @@ prop_iter_finalize(FreeOp *fop, RawObject obj)
}
static void
prop_iter_trace(JSTracer *trc, RawObject obj)
prop_iter_trace(JSTracer *trc, JSObject *obj)
{
void *pdata = obj->getPrivate();
if (!pdata)
@ -4603,7 +4603,7 @@ prop_iter_trace(JSTracer *trc, RawObject obj)
* barrier here because the pointer is updated via setPrivate, which
* always takes a barrier.
*/
RawShape tmp = static_cast<RawShape>(pdata);
Shape *tmp = static_cast<Shape *>(pdata);
MarkShapeUnbarriered(trc, &tmp, "prop iter shape");
obj->setPrivateUnbarriered(tmp);
} else {
@ -4675,7 +4675,7 @@ JS_NextProperty(JSContext *cx, JSObject *iterobjArg, jsid *idp)
if (i < 0) {
/* Native case: private data is a property tree node pointer. */
JS_ASSERT(iterobj->getParent()->isNative());
RawShape shape = static_cast<RawShape>(iterobj->getPrivate());
Shape *shape = static_cast<Shape *>(iterobj->getPrivate());
while (shape->previous() && !shape->enumerable())
shape = shape->previous();
@ -4684,7 +4684,7 @@ JS_NextProperty(JSContext *cx, JSObject *iterobjArg, jsid *idp)
JS_ASSERT(shape->isEmptyShape());
*idp = JSID_VOID;
} else {
iterobj->setPrivateGCThing(const_cast<RawShape>(shape->previous().get()));
iterobj->setPrivateGCThing(const_cast<Shape *>(shape->previous().get()));
*idp = shape->propid();
}
} else {
@ -4719,13 +4719,13 @@ JS_ArrayIterator(JSContext *cx, unsigned argc, jsval *vp)
}
JS_PUBLIC_API(jsval)
JS_GetReservedSlot(RawObject obj, uint32_t index)
JS_GetReservedSlot(JSObject *obj, uint32_t index)
{
return obj->getReservedSlot(index);
}
JS_PUBLIC_API(void)
JS_SetReservedSlot(RawObject obj, uint32_t index, RawValue value)
JS_SetReservedSlot(JSObject *obj, uint32_t index, Value value)
{
obj->setReservedSlot(index, value);
}
@ -4935,13 +4935,13 @@ JS_GetFunctionArity(JSFunction *fun)
}
JS_PUBLIC_API(JSBool)
JS_ObjectIsFunction(JSContext *cx, RawObject obj)
JS_ObjectIsFunction(JSContext *cx, JSObject *obj)
{
return obj->isFunction();
}
JS_PUBLIC_API(JSBool)
JS_ObjectIsCallable(JSContext *cx, RawObject obj)
JS_ObjectIsCallable(JSContext *cx, JSObject *obj)
{
return obj->isCallable();
}
@ -5073,7 +5073,7 @@ JS_DefineFunctions(JSContext *cx, JSObject *objArg, const JSFunctionSpec *fs)
return JS_FALSE;
}
} else {
RawFunction fun = DefineFunction(cx, obj, id, /* native = */ NULL, fs->nargs, 0,
JSFunction *fun = DefineFunction(cx, obj, id, /* native = */ NULL, fs->nargs, 0,
JSFunction::ExtendedFinalizeKind, SingletonObject);
if (!fun)
return JS_FALSE;
@ -7198,7 +7198,7 @@ JS::AssertArgumentsAreSane(JSContext *cx, const JS::Value &value)
#endif /* DEBUG */
JS_PUBLIC_API(void *)
JS_EncodeScript(JSContext *cx, RawScript scriptArg, uint32_t *lengthp)
JS_EncodeScript(JSContext *cx, JSScript *scriptArg, uint32_t *lengthp)
{
XDREncoder encoder(cx);
RootedScript script(cx, scriptArg);

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

@ -1317,7 +1317,7 @@ JSID_TO_GCTHING(jsid id)
*/
static JS_ALWAYS_INLINE JSBool
JSID_IS_VOID(const js::RawId id)
JSID_IS_VOID(const jsid id)
{
JS_ASSERT_IF(((size_t)JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_VOID,
JSID_BITS(id) == JSID_TYPE_VOID);
@ -1325,7 +1325,7 @@ JSID_IS_VOID(const js::RawId id)
}
static JS_ALWAYS_INLINE JSBool
JSID_IS_EMPTY(const js::RawId id)
JSID_IS_EMPTY(const jsid id)
{
return ((size_t)JSID_BITS(id) == JSID_TYPE_OBJECT);
}

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