mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
back out 3a8893b28489 (bug 712939) and 39adab158c17,16add78c43e3,37193db7e15b (bug 712873), for build bustage.
This commit is contained in:
parent
fa11d4a075
commit
c516662c22
@ -234,7 +234,7 @@ nsDOMMultipartFile::ParseBlobArrayArgument(JSContext* aCx, JS::Value& aValue,
|
||||
BlobSet blobSet;
|
||||
|
||||
uint32_t length;
|
||||
MOZ_ALWAYS_TRUE(JS_GetArrayLength(aCx, obj, &length));
|
||||
JS_ALWAYS_TRUE(JS_GetArrayLength(aCx, obj, &length));
|
||||
for (uint32_t i = 0; i < length; ++i) {
|
||||
JS::Rooted<JS::Value> element(aCx);
|
||||
if (!JS_GetElement(aCx, obj, i, &element))
|
||||
|
@ -214,7 +214,7 @@ MmsMessage::Create(int32_t aId,
|
||||
}
|
||||
|
||||
uint32_t length;
|
||||
MOZ_ALWAYS_TRUE(JS_GetArrayLength(aCx, deliveryInfoObj, &length));
|
||||
JS_ALWAYS_TRUE(JS_GetArrayLength(aCx, deliveryInfoObj, &length));
|
||||
|
||||
nsTArray<MmsDeliveryInfo> deliveryInfo;
|
||||
JS::Rooted<JS::Value> infoJsVal(aCx);
|
||||
@ -240,7 +240,7 @@ MmsMessage::Create(int32_t aId,
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
MOZ_ALWAYS_TRUE(JS_GetArrayLength(aCx, receiversObj, &length));
|
||||
JS_ALWAYS_TRUE(JS_GetArrayLength(aCx, receiversObj, &length));
|
||||
|
||||
nsTArray<nsString> receivers;
|
||||
JS::Rooted<JS::Value> receiverJsVal(aCx);
|
||||
@ -275,7 +275,7 @@ MmsMessage::Create(int32_t aId,
|
||||
}
|
||||
|
||||
nsTArray<MmsAttachment> attachments;
|
||||
MOZ_ALWAYS_TRUE(JS_GetArrayLength(aCx, attachmentsObj, &length));
|
||||
JS_ALWAYS_TRUE(JS_GetArrayLength(aCx, attachmentsObj, &length));
|
||||
|
||||
JS::Rooted<JS::Value> attachmentJsVal(aCx);
|
||||
for (uint32_t i = 0; i < length; ++i) {
|
||||
|
@ -350,7 +350,7 @@ MobileMessageManager::Delete(JS::Handle<JS::Value> aParam, JSContext* aCx,
|
||||
// Int32[], SmsMessage[], or MmsMessage[]
|
||||
JS::Rooted<JSObject*> ids(aCx, &aParam.toObject());
|
||||
|
||||
MOZ_ALWAYS_TRUE(JS_GetArrayLength(aCx, ids, &size));
|
||||
JS_ALWAYS_TRUE(JS_GetArrayLength(aCx, ids, &size));
|
||||
nsAutoArrayPtr<int32_t> idAutoArray(new int32_t[size]);
|
||||
|
||||
JS::Rooted<JS::Value> idJsValue(aCx);
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "nsTArrayHelpers.h" // For nsTArrayToJSArray
|
||||
#include "mozilla/dom/mobilemessage/Constants.h" // For MessageType
|
||||
|
||||
|
||||
using namespace mozilla::dom::mobilemessage;
|
||||
|
||||
DOMCI_DATA(MozMobileMessageThread, mozilla::dom::MobileMessageThread)
|
||||
@ -60,7 +61,7 @@ MobileMessageThread::Create(const uint64_t aId,
|
||||
}
|
||||
|
||||
uint32_t length;
|
||||
MOZ_ALWAYS_TRUE(JS_GetArrayLength(aCx, obj, &length));
|
||||
JS_ALWAYS_TRUE(JS_GetArrayLength(aCx, obj, &length));
|
||||
NS_ENSURE_TRUE(length, NS_ERROR_INVALID_ARG);
|
||||
|
||||
for (uint32_t i = 0; i < length; ++i) {
|
||||
|
@ -172,7 +172,7 @@ SmsFilter::SetNumbers(JSContext* aCx, JS::Handle<JS::Value> aNumbers)
|
||||
}
|
||||
|
||||
uint32_t size;
|
||||
MOZ_ALWAYS_TRUE(JS_GetArrayLength(aCx, obj, &size));
|
||||
JS_ALWAYS_TRUE(JS_GetArrayLength(aCx, obj, &size));
|
||||
|
||||
nsTArray<nsString> numbers;
|
||||
|
||||
|
@ -1589,7 +1589,7 @@ NPObjWrapper_NewResolve(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsi
|
||||
static bool
|
||||
NPObjWrapper_Convert(JSContext *cx, JS::Handle<JSObject*> obj, JSType hint, JS::MutableHandle<JS::Value> vp)
|
||||
{
|
||||
MOZ_ASSERT(hint == JSTYPE_NUMBER || hint == JSTYPE_STRING || hint == JSTYPE_VOID);
|
||||
JS_ASSERT(hint == JSTYPE_NUMBER || hint == JSTYPE_STRING || hint == JSTYPE_VOID);
|
||||
|
||||
// Plugins do not simply use JS_ConvertStub, and the default [[DefaultValue]]
|
||||
// behavior, because that behavior involves calling toString or valueOf on
|
||||
|
@ -70,8 +70,7 @@ namespace mozilla {
|
||||
namespace plugins {
|
||||
namespace parent {
|
||||
|
||||
static_assert(sizeof(NPIdentifier) == sizeof(jsid),
|
||||
"NPIdentifier must be binary compatible with jsid.");
|
||||
JS_STATIC_ASSERT(sizeof(NPIdentifier) == sizeof(jsid));
|
||||
|
||||
inline jsid
|
||||
NPIdentifierToJSId(NPIdentifier id)
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
static JSObject*
|
||||
Create(JSContext* aCx, nsIDOMBlob* aBlob)
|
||||
{
|
||||
MOZ_ASSERT(SameCOMIdentity(static_cast<nsISupports*>(aBlob), aBlob));
|
||||
JS_ASSERT(SameCOMIdentity(static_cast<nsISupports*>(aBlob), aBlob));
|
||||
|
||||
JSObject* obj = JS_NewObject(aCx, &sClass, JS::NullPtr(), JS::NullPtr());
|
||||
if (obj) {
|
||||
@ -101,7 +101,7 @@ private:
|
||||
static void
|
||||
Finalize(JSFreeOp* aFop, JSObject* aObj)
|
||||
{
|
||||
MOZ_ASSERT(JS_GetClass(aObj) == &sClass);
|
||||
JS_ASSERT(JS_GetClass(aObj) == &sClass);
|
||||
|
||||
nsIDOMBlob* blob = GetPrivate(aObj);
|
||||
NS_IF_RELEASE(blob);
|
||||
@ -248,7 +248,7 @@ public:
|
||||
static JSObject*
|
||||
Create(JSContext* aCx, nsIDOMFile* aFile)
|
||||
{
|
||||
MOZ_ASSERT(SameCOMIdentity(static_cast<nsISupports*>(aFile), aFile));
|
||||
JS_ASSERT(SameCOMIdentity(static_cast<nsISupports*>(aFile), aFile));
|
||||
|
||||
JSObject* obj = JS_NewObject(aCx, &sClass, JS::NullPtr(), JS::NullPtr());
|
||||
if (obj) {
|
||||
@ -266,7 +266,7 @@ public:
|
||||
if (classPtr == &sClass) {
|
||||
nsISupports* priv = static_cast<nsISupports*>(JS_GetPrivate(aObj));
|
||||
nsCOMPtr<nsIDOMFile> file = do_QueryInterface(priv);
|
||||
MOZ_ASSERT_IF(priv, file);
|
||||
JS_ASSERT_IF(priv, file);
|
||||
return file;
|
||||
}
|
||||
}
|
||||
@ -306,7 +306,7 @@ private:
|
||||
static void
|
||||
Finalize(JSFreeOp* aFop, JSObject* aObj)
|
||||
{
|
||||
MOZ_ASSERT(JS_GetClass(aObj) == &sClass);
|
||||
JS_ASSERT(JS_GetClass(aObj) == &sClass);
|
||||
|
||||
nsIDOMFile* file = GetPrivate(aObj);
|
||||
NS_IF_RELEASE(file);
|
||||
@ -450,7 +450,7 @@ Blob::GetPrivate(JSObject* aObj)
|
||||
if (classPtr == &sClass || classPtr == File::Class()) {
|
||||
nsISupports* priv = static_cast<nsISupports*>(JS_GetPrivate(aObj));
|
||||
nsCOMPtr<nsIDOMBlob> blob = do_QueryInterface(priv);
|
||||
MOZ_ASSERT_IF(priv, blob);
|
||||
JS_ASSERT_IF(priv, blob);
|
||||
return blob;
|
||||
}
|
||||
}
|
||||
|
@ -302,11 +302,11 @@ struct WorkerStructuredCloneCallbacks
|
||||
{
|
||||
// See if object is a nsIDOMFile pointer.
|
||||
if (aTag == DOMWORKER_SCTAG_FILE) {
|
||||
MOZ_ASSERT(!aData);
|
||||
JS_ASSERT(!aData);
|
||||
|
||||
nsIDOMFile* file;
|
||||
if (JS_ReadBytes(aReader, &file, sizeof(file))) {
|
||||
MOZ_ASSERT(file);
|
||||
JS_ASSERT(file);
|
||||
|
||||
#ifdef DEBUG
|
||||
{
|
||||
@ -327,11 +327,11 @@ struct WorkerStructuredCloneCallbacks
|
||||
}
|
||||
// See if object is a nsIDOMBlob pointer.
|
||||
else if (aTag == DOMWORKER_SCTAG_BLOB) {
|
||||
MOZ_ASSERT(!aData);
|
||||
JS_ASSERT(!aData);
|
||||
|
||||
nsIDOMBlob* blob;
|
||||
if (JS_ReadBytes(aReader, &blob, sizeof(blob))) {
|
||||
MOZ_ASSERT(blob);
|
||||
JS_ASSERT(blob);
|
||||
|
||||
#ifdef DEBUG
|
||||
{
|
||||
@ -352,7 +352,7 @@ struct WorkerStructuredCloneCallbacks
|
||||
}
|
||||
// See if the object is an ImageData.
|
||||
else if (aTag == SCTAG_DOM_IMAGEDATA) {
|
||||
MOZ_ASSERT(!aData);
|
||||
JS_ASSERT(!aData);
|
||||
|
||||
// Read the information out of the stream.
|
||||
uint32_t width, height;
|
||||
@ -459,11 +459,11 @@ struct MainThreadWorkerStructuredCloneCallbacks
|
||||
|
||||
// See if object is a nsIDOMFile pointer.
|
||||
if (aTag == DOMWORKER_SCTAG_FILE) {
|
||||
MOZ_ASSERT(!aData);
|
||||
JS_ASSERT(!aData);
|
||||
|
||||
nsIDOMFile* file;
|
||||
if (JS_ReadBytes(aReader, &file, sizeof(file))) {
|
||||
MOZ_ASSERT(file);
|
||||
JS_ASSERT(file);
|
||||
|
||||
#ifdef DEBUG
|
||||
{
|
||||
@ -493,11 +493,11 @@ struct MainThreadWorkerStructuredCloneCallbacks
|
||||
}
|
||||
// See if object is a nsIDOMBlob pointer.
|
||||
else if (aTag == DOMWORKER_SCTAG_BLOB) {
|
||||
MOZ_ASSERT(!aData);
|
||||
JS_ASSERT(!aData);
|
||||
|
||||
nsIDOMBlob* blob;
|
||||
if (JS_ReadBytes(aReader, &blob, sizeof(blob))) {
|
||||
MOZ_ASSERT(blob);
|
||||
JS_ASSERT(blob);
|
||||
|
||||
#ifdef DEBUG
|
||||
{
|
||||
|
@ -180,7 +180,7 @@ JavaScriptShared::toVariant(JSContext *cx, JS::HandleValue from, JSVariant *to)
|
||||
{
|
||||
RootedObject obj(cx, from.toObjectOrNull());
|
||||
if (!obj) {
|
||||
MOZ_ASSERT(from == JSVAL_NULL);
|
||||
JS_ASSERT(from == JSVAL_NULL);
|
||||
*to = uint64_t(0);
|
||||
return true;
|
||||
}
|
||||
|
@ -734,13 +734,13 @@ extern JSDStaticLock* _jsd_global_lock;
|
||||
JS_BEGIN_MACRO \
|
||||
if(!_jsd_global_lock) \
|
||||
_jsd_global_lock = jsd_CreateLock(); \
|
||||
MOZ_ASSERT(_jsd_global_lock); \
|
||||
JS_ASSERT(_jsd_global_lock); \
|
||||
jsd_Lock(_jsd_global_lock); \
|
||||
JS_END_MACRO
|
||||
|
||||
#define JSD_UNLOCK() \
|
||||
JS_BEGIN_MACRO \
|
||||
MOZ_ASSERT(_jsd_global_lock); \
|
||||
JS_ASSERT(_jsd_global_lock); \
|
||||
jsd_Unlock(_jsd_global_lock); \
|
||||
JS_END_MACRO
|
||||
|
||||
|
@ -39,9 +39,9 @@ _testAtoms(JSDContext*jsdc)
|
||||
static int
|
||||
_atom_smasher(JSHashEntry *he, int i, void *arg)
|
||||
{
|
||||
MOZ_ASSERT(he);
|
||||
MOZ_ASSERT(he->value);
|
||||
MOZ_ASSERT(((JSDAtom*)(he->value))->str);
|
||||
JS_ASSERT(he);
|
||||
JS_ASSERT(he->value);
|
||||
JS_ASSERT(((JSDAtom*)(he->value))->str);
|
||||
|
||||
free(((JSDAtom*)(he->value))->str);
|
||||
free(he->value);
|
||||
@ -93,7 +93,7 @@ jsd_AddAtom(JSDContext* jsdc, const char* str)
|
||||
|
||||
if(!str)
|
||||
{
|
||||
MOZ_ASSERT(0);
|
||||
JS_ASSERT(0);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -34,9 +34,9 @@ JSDStaticLock* _jsd_global_lock = nullptr;
|
||||
#ifdef DEBUG
|
||||
void JSD_ASSERT_VALID_CONTEXT(JSDContext* jsdc)
|
||||
{
|
||||
MOZ_ASSERT(jsdc->inited);
|
||||
MOZ_ASSERT(jsdc->jsrt);
|
||||
MOZ_ASSERT(jsdc->glob);
|
||||
JS_ASSERT(jsdc->inited);
|
||||
JS_ASSERT(jsdc->jsrt);
|
||||
JS_ASSERT(jsdc->glob);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -209,8 +209,8 @@ jsd_DebuggerOnForUser(JSRuntime* jsrt,
|
||||
JSDContext*
|
||||
jsd_DebuggerOn(void)
|
||||
{
|
||||
MOZ_ASSERT(_jsrt);
|
||||
MOZ_ASSERT(_validateUserCallbacks(&_callbacks));
|
||||
JS_ASSERT(_jsrt);
|
||||
JS_ASSERT(_validateUserCallbacks(&_callbacks));
|
||||
return jsd_DebuggerOnForUser(_jsrt, &_callbacks, _user, nullptr);
|
||||
}
|
||||
|
||||
@ -337,7 +337,7 @@ jsd_DebugErrorHook(JSContext *cx, const char *message,
|
||||
|
||||
if( ! jsdc )
|
||||
{
|
||||
MOZ_ASSERT(0);
|
||||
JS_ASSERT(0);
|
||||
return true;
|
||||
}
|
||||
if( JSD_IS_DANGEROUS_THREAD(jsdc) )
|
||||
@ -380,7 +380,7 @@ jsd_DebugErrorHook(JSContext *cx, const char *message,
|
||||
JS_ClearPendingException(cx);
|
||||
return false;
|
||||
default:
|
||||
MOZ_ASSERT(0);
|
||||
JS_ASSERT(0);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
|
@ -159,10 +159,10 @@ jsd_CallExecutionHook(JSDContext* jsdc,
|
||||
break;
|
||||
case JSD_HOOK_RETURN_CONTINUE_THROW:
|
||||
/* only makes sense for jsd_ThrowHandler (which init'd rval) */
|
||||
MOZ_ASSERT(JSD_HOOK_THROW == type);
|
||||
JS_ASSERT(JSD_HOOK_THROW == type);
|
||||
return JSTRAP_THROW;
|
||||
default:
|
||||
MOZ_ASSERT(0);
|
||||
JS_ASSERT(0);
|
||||
break;
|
||||
}
|
||||
return JSTRAP_CONTINUE;
|
||||
|
@ -58,13 +58,13 @@ JS_BEGIN_MACRO \
|
||||
if(!out) \
|
||||
out = (void*) JS_AttachThread(PR_USER_THREAD, PR_PRIORITY_NORMAL, \
|
||||
nullptr); \
|
||||
MOZ_ASSERT(out); \
|
||||
JS_ASSERT(out); \
|
||||
JS_END_MACRO
|
||||
#else
|
||||
#define _CURRENT_THREAD(out) \
|
||||
JS_BEGIN_MACRO \
|
||||
out = (void*) PR_GetCurrentThread(); \
|
||||
MOZ_ASSERT(out); \
|
||||
JS_ASSERT(out); \
|
||||
JS_END_MACRO
|
||||
#endif
|
||||
|
||||
@ -72,10 +72,10 @@ JS_END_MACRO
|
||||
#define JSD_LOCK_SIG 0x10CC10CC
|
||||
void ASSERT_VALID_LOCK(JSDStaticLock* lock)
|
||||
{
|
||||
MOZ_ASSERT(lock);
|
||||
MOZ_ASSERT(lock->lock);
|
||||
MOZ_ASSERT(lock->count >= 0);
|
||||
MOZ_ASSERT(lock->sig == (uint16_t) JSD_LOCK_SIG);
|
||||
JS_ASSERT(lock);
|
||||
JS_ASSERT(lock->lock);
|
||||
JS_ASSERT(lock->count >= 0);
|
||||
JS_ASSERT(lock->sig == (uint16_t) JSD_LOCK_SIG);
|
||||
}
|
||||
#else
|
||||
#define ASSERT_VALID_LOCK(x) ((void)0)
|
||||
@ -111,13 +111,13 @@ jsd_Lock(JSDStaticLock* lock)
|
||||
if(lock->owner == me)
|
||||
{
|
||||
lock->count++;
|
||||
MOZ_ASSERT(lock->count > 1);
|
||||
JS_ASSERT(lock->count > 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
PR_Lock(lock->lock); /* this can block... */
|
||||
MOZ_ASSERT(lock->owner == 0);
|
||||
MOZ_ASSERT(lock->count == 0);
|
||||
JS_ASSERT(lock->owner == 0);
|
||||
JS_ASSERT(lock->count == 0);
|
||||
lock->count = 1;
|
||||
lock->owner = me;
|
||||
}
|
||||
@ -131,7 +131,7 @@ jsd_Unlock(JSDStaticLock* lock)
|
||||
_CURRENT_THREAD(me);
|
||||
|
||||
/* it's an error to unlock a lock you don't own */
|
||||
MOZ_ASSERT(lock->owner == me);
|
||||
JS_ASSERT(lock->owner == me);
|
||||
if(lock->owner != me)
|
||||
return;
|
||||
|
||||
@ -151,7 +151,7 @@ jsd_IsLocked(JSDStaticLock* lock)
|
||||
_CURRENT_THREAD(me);
|
||||
if (lock->owner != me)
|
||||
return false;
|
||||
MOZ_ASSERT(lock->count > 0);
|
||||
JS_ASSERT(lock->count > 0);
|
||||
return true;
|
||||
}
|
||||
#endif /* DEBUG */
|
||||
|
@ -55,9 +55,9 @@ _traceObj(JSDContext* jsdc, JSDObject* jsdobj, int which)
|
||||
#ifdef DEBUG
|
||||
void JSD_ASSERT_VALID_OBJECT(JSDObject* jsdobj)
|
||||
{
|
||||
MOZ_ASSERT(jsdobj);
|
||||
MOZ_ASSERT(!JS_CLIST_IS_EMPTY(&jsdobj->links));
|
||||
MOZ_ASSERT(jsdobj->obj);
|
||||
JS_ASSERT(jsdobj);
|
||||
JS_ASSERT(!JS_CLIST_IS_EMPTY(&jsdobj->links));
|
||||
JS_ASSERT(jsdobj->obj);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -65,7 +65,7 @@ void JSD_ASSERT_VALID_OBJECT(JSDObject* jsdobj)
|
||||
static void
|
||||
_destroyJSDObject(JSDContext* jsdc, JSDObject* jsdobj)
|
||||
{
|
||||
MOZ_ASSERT(JSD_OBJECTS_LOCKED(jsdc));
|
||||
JS_ASSERT(JSD_OBJECTS_LOCKED(jsdc));
|
||||
|
||||
JS_REMOVE_LINK(&jsdobj->links);
|
||||
JS_HashTableRemove(jsdc->objectsTable, jsdobj->obj);
|
||||
@ -156,7 +156,7 @@ jsd_IterateObjects(JSDContext* jsdc, JSDObject** iterp)
|
||||
{
|
||||
JSDObject *jsdobj = *iterp;
|
||||
|
||||
MOZ_ASSERT(JSD_OBJECTS_LOCKED(jsdc));
|
||||
JS_ASSERT(JSD_OBJECTS_LOCKED(jsdc));
|
||||
|
||||
if( !jsdobj )
|
||||
jsdobj = (JSDObject *)jsdc->objectsList.next;
|
||||
|
@ -28,13 +28,13 @@ using mozilla::AutoSafeJSContext;
|
||||
#ifdef DEBUG
|
||||
void JSD_ASSERT_VALID_SCRIPT(JSDScript* jsdscript)
|
||||
{
|
||||
MOZ_ASSERT(jsdscript);
|
||||
MOZ_ASSERT(jsdscript->script);
|
||||
JS_ASSERT(jsdscript);
|
||||
JS_ASSERT(jsdscript->script);
|
||||
}
|
||||
void JSD_ASSERT_VALID_EXEC_HOOK(JSDExecHook* jsdhook)
|
||||
{
|
||||
MOZ_ASSERT(jsdhook);
|
||||
MOZ_ASSERT(jsdhook->hook);
|
||||
JS_ASSERT(jsdhook);
|
||||
JS_ASSERT(jsdhook->hook);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -51,7 +51,7 @@ _newJSDScript(JSDContext* jsdc,
|
||||
unsigned lineno;
|
||||
const char* raw_filename;
|
||||
|
||||
MOZ_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
|
||||
JS_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
|
||||
|
||||
/* these are inlined javascript: urls and we can't handle them now */
|
||||
lineno = (unsigned) JS_GetScriptBaseLineNumber(cx, script);
|
||||
@ -82,7 +82,7 @@ static void
|
||||
_destroyJSDScript(JSDContext* jsdc,
|
||||
JSDScript* jsdscript)
|
||||
{
|
||||
MOZ_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
|
||||
JS_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
|
||||
|
||||
/* destroy all hooks */
|
||||
jsd_ClearAllExecutionHooksForScript(jsdc, jsdscript);
|
||||
@ -130,7 +130,7 @@ _dumpJSDScript(JSDContext* jsdc, JSDScript* jsdscript, const char* leadingtext)
|
||||
n += size_t(snprintf(Buf + n, sizeof(Buf) - n, "%s", "no fun"));
|
||||
} else {
|
||||
n += JS_PutEscapedFlatString(Buf + n, sizeof(Buf) - n,
|
||||
MOZ_ASSERT_STRING_IS_FLAT(fun), 0);
|
||||
JS_ASSERT_STRING_IS_FLAT(fun), 0);
|
||||
Buf[sizeof(Buf) - 1] = '\0';
|
||||
}
|
||||
if (n + 1 < sizeof(Buf))
|
||||
@ -218,7 +218,7 @@ JSDScript*
|
||||
jsd_FindJSDScript( JSDContext* jsdc,
|
||||
JSScript *script )
|
||||
{
|
||||
MOZ_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
|
||||
JS_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
|
||||
return (JSDScript*) JS_HashTableLookup(jsdc->scriptsTable, (void *)script);
|
||||
}
|
||||
|
||||
@ -230,7 +230,7 @@ jsd_FindOrCreateJSDScript(JSDContext *jsdc,
|
||||
{
|
||||
JS::RootedScript script(cx, script_);
|
||||
JSDScript *jsdscript;
|
||||
MOZ_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
|
||||
JS_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
|
||||
|
||||
jsdscript = jsd_FindJSDScript(jsdc, script);
|
||||
if (jsdscript)
|
||||
@ -369,7 +369,7 @@ jsd_IterateScripts(JSDContext* jsdc, JSDScript **iterp)
|
||||
{
|
||||
JSDScript *jsdscript = *iterp;
|
||||
|
||||
MOZ_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
|
||||
JS_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
|
||||
|
||||
if( !jsdscript )
|
||||
jsdscript = (JSDScript *)jsdc->scripts.next;
|
||||
@ -398,7 +398,7 @@ jsd_IsActiveScript(JSDContext* jsdc, JSDScript *jsdscript)
|
||||
{
|
||||
JSDScript *current;
|
||||
|
||||
MOZ_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
|
||||
JS_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
|
||||
|
||||
for( current = (JSDScript *)jsdc->scripts.next;
|
||||
current != (JSDScript *)&jsdc->scripts;
|
||||
@ -720,9 +720,9 @@ jsd_TrapHandler(JSContext *cx, JSScript *script_, jsbytecode *pc, jsval *rval,
|
||||
}
|
||||
|
||||
JSD_ASSERT_VALID_EXEC_HOOK(jsdhook);
|
||||
MOZ_ASSERT(!jsdhook->pc || jsdhook->pc == (uintptr_t)pc);
|
||||
MOZ_ASSERT(jsdhook->jsdscript->script == script);
|
||||
MOZ_ASSERT(jsdhook->jsdscript->jsdc == jsdc);
|
||||
JS_ASSERT(!jsdhook->pc || jsdhook->pc == (uintptr_t)pc);
|
||||
JS_ASSERT(jsdhook->jsdscript->script == script);
|
||||
JS_ASSERT(jsdhook->jsdscript->jsdc == jsdc);
|
||||
|
||||
hook = jsdhook->hook;
|
||||
hookData = jsdhook->callerdata;
|
||||
|
@ -17,14 +17,14 @@ using mozilla::AutoPushJSContext;
|
||||
#ifdef DEBUG
|
||||
void JSD_ASSERT_VALID_THREAD_STATE(JSDThreadState* jsdthreadstate)
|
||||
{
|
||||
MOZ_ASSERT(jsdthreadstate);
|
||||
MOZ_ASSERT(jsdthreadstate->stackDepth > 0);
|
||||
JS_ASSERT(jsdthreadstate);
|
||||
JS_ASSERT(jsdthreadstate->stackDepth > 0);
|
||||
}
|
||||
|
||||
void JSD_ASSERT_VALID_STACK_FRAME(JSDStackFrameInfo* jsdframe)
|
||||
{
|
||||
MOZ_ASSERT(jsdframe);
|
||||
MOZ_ASSERT(jsdframe->jsdthreadstate);
|
||||
JS_ASSERT(jsdframe);
|
||||
JS_ASSERT(jsdframe->jsdthreadstate);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -148,8 +148,8 @@ jsd_DestroyThreadState(JSDContext* jsdc, JSDThreadState* jsdthreadstate)
|
||||
JSDStackFrameInfo* jsdframe;
|
||||
JSCList* list;
|
||||
|
||||
MOZ_ASSERT(jsdthreadstate);
|
||||
MOZ_ASSERT(JSD_CURRENT_THREAD() == jsdthreadstate->thread);
|
||||
JS_ASSERT(jsdthreadstate);
|
||||
JS_ASSERT(JSD_CURRENT_THREAD() == jsdthreadstate->thread);
|
||||
|
||||
JSD_LOCK_THREADSTATES(jsdc);
|
||||
JS_REMOVE_LINK(&jsdthreadstate->links);
|
||||
@ -402,7 +402,7 @@ jsd_EvaluateUCScriptInStackFrame(JSDContext* jsdc,
|
||||
bool valid;
|
||||
JSExceptionState* exceptionState = nullptr;
|
||||
|
||||
MOZ_ASSERT(JSD_CURRENT_THREAD() == jsdthreadstate->thread);
|
||||
JS_ASSERT(JSD_CURRENT_THREAD() == jsdthreadstate->thread);
|
||||
|
||||
JSD_LOCK_THREADSTATES(jsdc);
|
||||
valid = jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe);
|
||||
@ -412,7 +412,7 @@ jsd_EvaluateUCScriptInStackFrame(JSDContext* jsdc,
|
||||
return false;
|
||||
|
||||
AutoPushJSContext cx(jsdthreadstate->context);
|
||||
MOZ_ASSERT(cx);
|
||||
JS_ASSERT(cx);
|
||||
|
||||
if (eatExceptions)
|
||||
exceptionState = JS_SaveExceptionState(cx);
|
||||
@ -439,7 +439,7 @@ jsd_EvaluateScriptInStackFrame(JSDContext* jsdc,
|
||||
bool valid;
|
||||
JSExceptionState* exceptionState = nullptr;
|
||||
|
||||
MOZ_ASSERT(JSD_CURRENT_THREAD() == jsdthreadstate->thread);
|
||||
JS_ASSERT(JSD_CURRENT_THREAD() == jsdthreadstate->thread);
|
||||
|
||||
JSD_LOCK_THREADSTATES(jsdc);
|
||||
valid = jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe);
|
||||
@ -449,7 +449,7 @@ jsd_EvaluateScriptInStackFrame(JSDContext* jsdc,
|
||||
return false;
|
||||
|
||||
AutoPushJSContext cx(jsdthreadstate->context);
|
||||
MOZ_ASSERT(cx);
|
||||
JS_ASSERT(cx);
|
||||
|
||||
if (eatExceptions)
|
||||
exceptionState = JS_SaveExceptionState(cx);
|
||||
@ -483,7 +483,7 @@ jsd_ValToStringInStackFrame(JSDContext* jsdc,
|
||||
return nullptr;
|
||||
|
||||
cx = jsdthreadstate->context;
|
||||
MOZ_ASSERT(cx);
|
||||
JS_ASSERT(cx);
|
||||
|
||||
JS::RootedValue v(cx, val);
|
||||
exceptionState = JS_SaveExceptionState(cx);
|
||||
@ -499,7 +499,7 @@ jsd_IsValidThreadState(JSDContext* jsdc,
|
||||
{
|
||||
JSDThreadState *cur;
|
||||
|
||||
MOZ_ASSERT( JSD_THREADSTATES_LOCKED(jsdc) );
|
||||
JS_ASSERT( JSD_THREADSTATES_LOCKED(jsdc) );
|
||||
|
||||
for( cur = (JSDThreadState*)jsdc->threadsStates.next;
|
||||
cur != (JSDThreadState*)&jsdc->threadsStates;
|
||||
@ -516,7 +516,7 @@ jsd_IsValidFrameInThreadState(JSDContext* jsdc,
|
||||
JSDThreadState* jsdthreadstate,
|
||||
JSDStackFrameInfo* jsdframe)
|
||||
{
|
||||
MOZ_ASSERT(JSD_THREADSTATES_LOCKED(jsdc));
|
||||
JS_ASSERT(JSD_THREADSTATES_LOCKED(jsdc));
|
||||
|
||||
if( ! jsd_IsValidThreadState(jsdc, jsdthreadstate) )
|
||||
return false;
|
||||
|
@ -72,7 +72,7 @@ _interpreterTrace(JSDContext* jsdc, JSContext *cx, JSAbstractFramePtr frame,
|
||||
puts("<unavailable>");
|
||||
}
|
||||
printf("\n");
|
||||
MOZ_ASSERT(indent >= 0);
|
||||
JS_ASSERT(indent >= 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -15,8 +15,8 @@
|
||||
#ifdef DEBUG
|
||||
void JSD_ASSERT_VALID_SOURCE_TEXT(JSDSourceText* jsdsrc)
|
||||
{
|
||||
MOZ_ASSERT(jsdsrc);
|
||||
MOZ_ASSERT(jsdsrc->url);
|
||||
JS_ASSERT(jsdsrc);
|
||||
JS_ASSERT(jsdsrc->url);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -98,7 +98,7 @@ _newSource(JSDContext* jsdc, char* url)
|
||||
static void
|
||||
_destroySource(JSDContext* jsdc, JSDSourceText* jsdsrc)
|
||||
{
|
||||
MOZ_ASSERT(nullptr == jsdsrc->text); /* must _clearText() first */
|
||||
JS_ASSERT(nullptr == jsdsrc->text); /* must _clearText() first */
|
||||
free(jsdsrc->url);
|
||||
free(jsdsrc);
|
||||
}
|
||||
@ -491,7 +491,7 @@ jsd_StartingEvalUsingFilename(JSDContext* jsdc, const char* url)
|
||||
{
|
||||
#if 0
|
||||
#ifndef JSD_LOWLEVEL_SOURCE
|
||||
MOZ_ASSERT(! jsdsrc->doingEval);
|
||||
JS_ASSERT(! jsdsrc->doingEval);
|
||||
#endif
|
||||
#endif
|
||||
jsdsrc->doingEval = true;
|
||||
@ -515,7 +515,7 @@ jsd_FinishedEvalUsingFilename(JSDContext* jsdc, const char* url)
|
||||
* not have existed before the eval, but does exist now (without
|
||||
* this flag set!)
|
||||
*/
|
||||
MOZ_ASSERT(jsdsrc->doingEval);
|
||||
JS_ASSERT(jsdsrc->doingEval);
|
||||
#endif
|
||||
#endif
|
||||
jsdsrc->doingEval = false;
|
||||
|
@ -19,40 +19,40 @@ using mozilla::AutoSafeJSContext;
|
||||
#ifdef DEBUG
|
||||
void JSD_ASSERT_VALID_VALUE(JSDValue* jsdval)
|
||||
{
|
||||
MOZ_ASSERT(jsdval);
|
||||
MOZ_ASSERT(jsdval->nref > 0);
|
||||
JS_ASSERT(jsdval);
|
||||
JS_ASSERT(jsdval->nref > 0);
|
||||
if(!JS_CLIST_IS_EMPTY(&jsdval->props))
|
||||
{
|
||||
MOZ_ASSERT(CHECK_BIT_FLAG(jsdval->flags, GOT_PROPS));
|
||||
MOZ_ASSERT(!JSVAL_IS_PRIMITIVE(jsdval->val));
|
||||
JS_ASSERT(CHECK_BIT_FLAG(jsdval->flags, GOT_PROPS));
|
||||
JS_ASSERT(!JSVAL_IS_PRIMITIVE(jsdval->val));
|
||||
}
|
||||
|
||||
if(jsdval->proto)
|
||||
{
|
||||
MOZ_ASSERT(CHECK_BIT_FLAG(jsdval->flags, GOT_PROTO));
|
||||
MOZ_ASSERT(jsdval->proto->nref > 0);
|
||||
JS_ASSERT(CHECK_BIT_FLAG(jsdval->flags, GOT_PROTO));
|
||||
JS_ASSERT(jsdval->proto->nref > 0);
|
||||
}
|
||||
if(jsdval->parent)
|
||||
{
|
||||
MOZ_ASSERT(CHECK_BIT_FLAG(jsdval->flags, GOT_PARENT));
|
||||
MOZ_ASSERT(jsdval->parent->nref > 0);
|
||||
JS_ASSERT(CHECK_BIT_FLAG(jsdval->flags, GOT_PARENT));
|
||||
JS_ASSERT(jsdval->parent->nref > 0);
|
||||
}
|
||||
if(jsdval->ctor)
|
||||
{
|
||||
MOZ_ASSERT(CHECK_BIT_FLAG(jsdval->flags, GOT_CTOR));
|
||||
MOZ_ASSERT(jsdval->ctor->nref > 0);
|
||||
JS_ASSERT(CHECK_BIT_FLAG(jsdval->flags, GOT_CTOR));
|
||||
JS_ASSERT(jsdval->ctor->nref > 0);
|
||||
}
|
||||
}
|
||||
|
||||
void JSD_ASSERT_VALID_PROPERTY(JSDProperty* jsdprop)
|
||||
{
|
||||
MOZ_ASSERT(jsdprop);
|
||||
MOZ_ASSERT(jsdprop->name);
|
||||
MOZ_ASSERT(jsdprop->name->nref > 0);
|
||||
MOZ_ASSERT(jsdprop->val);
|
||||
MOZ_ASSERT(jsdprop->val->nref > 0);
|
||||
JS_ASSERT(jsdprop);
|
||||
JS_ASSERT(jsdprop->name);
|
||||
JS_ASSERT(jsdprop->name->nref > 0);
|
||||
JS_ASSERT(jsdprop->val);
|
||||
JS_ASSERT(jsdprop->val->nref > 0);
|
||||
if(jsdprop->alias)
|
||||
MOZ_ASSERT(jsdprop->alias->nref > 0);
|
||||
JS_ASSERT(jsdprop->alias->nref > 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -133,7 +133,7 @@ jsd_IsValueNative(JSDContext* jsdc, JSDValue* jsdval)
|
||||
fun = JSD_GetValueFunction(jsdc, jsdval);
|
||||
if(fun)
|
||||
ok = JS_GetFunctionScript(cx, fun) ? false : true;
|
||||
MOZ_ASSERT(fun);
|
||||
JS_ASSERT(fun);
|
||||
return ok;
|
||||
}
|
||||
return !JSVAL_IS_PRIMITIVE(jsdval->val);
|
||||
@ -275,7 +275,7 @@ jsd_NewValue(JSDContext* jsdc, jsval value)
|
||||
void
|
||||
jsd_DropValue(JSDContext* jsdc, JSDValue* jsdval)
|
||||
{
|
||||
MOZ_ASSERT(jsdval->nref > 0);
|
||||
JS_ASSERT(jsdval->nref > 0);
|
||||
if(0 == --jsdval->nref)
|
||||
{
|
||||
jsd_RefreshValue(jsdc, jsdval);
|
||||
@ -349,7 +349,7 @@ static void _freeProps(JSDContext* jsdc, JSDValue* jsdval)
|
||||
JS_REMOVE_AND_INIT_LINK(&jsdprop->links);
|
||||
jsd_DropProperty(jsdc, jsdprop);
|
||||
}
|
||||
MOZ_ASSERT(JS_CLIST_IS_EMPTY(&jsdval->props));
|
||||
JS_ASSERT(JS_CLIST_IS_EMPTY(&jsdval->props));
|
||||
CLEAR_BIT_FLAG(jsdval->flags, GOT_PROPS);
|
||||
}
|
||||
|
||||
@ -360,9 +360,9 @@ static bool _buildProps(JSDContext* jsdc, JSDValue* jsdval)
|
||||
JSPropertyDescArray pda;
|
||||
unsigned i;
|
||||
|
||||
MOZ_ASSERT(JS_CLIST_IS_EMPTY(&jsdval->props));
|
||||
MOZ_ASSERT(!(CHECK_BIT_FLAG(jsdval->flags, GOT_PROPS)));
|
||||
MOZ_ASSERT(!JSVAL_IS_PRIMITIVE(jsdval->val));
|
||||
JS_ASSERT(JS_CLIST_IS_EMPTY(&jsdval->props));
|
||||
JS_ASSERT(!(CHECK_BIT_FLAG(jsdval->flags, GOT_PROPS)));
|
||||
JS_ASSERT(!JSVAL_IS_PRIMITIVE(jsdval->val));
|
||||
|
||||
if(JSVAL_IS_PRIMITIVE(jsdval->val))
|
||||
return false;
|
||||
@ -453,7 +453,7 @@ jsd_IterateProperties(JSDContext* jsdc, JSDValue* jsdval, JSDProperty **iterp)
|
||||
JSDProperty* jsdprop = *iterp;
|
||||
if(!(CHECK_BIT_FLAG(jsdval->flags, GOT_PROPS)))
|
||||
{
|
||||
MOZ_ASSERT(!jsdprop);
|
||||
JS_ASSERT(!jsdprop);
|
||||
if(!_buildProps(jsdc, jsdval))
|
||||
return nullptr;
|
||||
}
|
||||
@ -464,7 +464,7 @@ jsd_IterateProperties(JSDContext* jsdc, JSDValue* jsdval, JSDProperty **iterp)
|
||||
return nullptr;
|
||||
*iterp = (JSDProperty*)jsdprop->links.next;
|
||||
|
||||
MOZ_ASSERT(jsdprop);
|
||||
JS_ASSERT(jsdprop);
|
||||
jsdprop->nref++;
|
||||
return jsdprop;
|
||||
}
|
||||
@ -586,7 +586,7 @@ jsd_GetValuePrototype(JSDContext* jsdc, JSDValue* jsdval)
|
||||
{
|
||||
JS::RootedObject obj(cx);
|
||||
JS::RootedObject proto(cx);
|
||||
MOZ_ASSERT(!jsdval->proto);
|
||||
JS_ASSERT(!jsdval->proto);
|
||||
SET_BIT_FLAG(jsdval->flags, GOT_PROTO);
|
||||
if(JSVAL_IS_PRIMITIVE(jsdval->val))
|
||||
return nullptr;
|
||||
@ -610,7 +610,7 @@ jsd_GetValueParent(JSDContext* jsdc, JSDValue* jsdval)
|
||||
AutoSafeJSContext cx;
|
||||
JS::RootedObject obj(cx);
|
||||
JS::RootedObject parent(cx);
|
||||
MOZ_ASSERT(!jsdval->parent);
|
||||
JS_ASSERT(!jsdval->parent);
|
||||
SET_BIT_FLAG(jsdval->flags, GOT_PARENT);
|
||||
if(JSVAL_IS_PRIMITIVE(jsdval->val))
|
||||
return nullptr;
|
||||
@ -637,7 +637,7 @@ jsd_GetValueConstructor(JSDContext* jsdc, JSDValue* jsdval)
|
||||
JS::RootedObject obj(cx);
|
||||
JS::RootedObject proto(cx);
|
||||
JS::RootedObject ctor(cx);
|
||||
MOZ_ASSERT(!jsdval->ctor);
|
||||
JS_ASSERT(!jsdval->ctor);
|
||||
SET_BIT_FLAG(jsdval->flags, GOT_CTOR);
|
||||
if(JSVAL_IS_PRIMITIVE(jsdval->val))
|
||||
return nullptr;
|
||||
@ -737,10 +737,10 @@ jsd_GetPropertyFlags(JSDContext* jsdc, JSDProperty* jsdprop)
|
||||
void
|
||||
jsd_DropProperty(JSDContext* jsdc, JSDProperty* jsdprop)
|
||||
{
|
||||
MOZ_ASSERT(jsdprop->nref > 0);
|
||||
JS_ASSERT(jsdprop->nref > 0);
|
||||
if(0 == --jsdprop->nref)
|
||||
{
|
||||
MOZ_ASSERT(JS_CLIST_IS_EMPTY(&jsdprop->links));
|
||||
JS_ASSERT(JS_CLIST_IS_EMPTY(&jsdprop->links));
|
||||
DROP_CLEAR_VALUE(jsdc, jsdprop->val);
|
||||
DROP_CLEAR_VALUE(jsdc, jsdprop->name);
|
||||
DROP_CLEAR_VALUE(jsdc, jsdprop->alias);
|
||||
|
@ -390,7 +390,7 @@ JSD_PUBLIC_API(JSDSourceText*)
|
||||
JSD_FindSourceForURL(JSDContext* jsdc, const char* url)
|
||||
{
|
||||
JSD_ASSERT_VALID_CONTEXT(jsdc);
|
||||
MOZ_ASSERT(url);
|
||||
JS_ASSERT(url);
|
||||
return jsd_FindSourceForURL(jsdc, url);
|
||||
}
|
||||
|
||||
@ -408,8 +408,8 @@ JSD_GetSourceText(JSDContext* jsdc, JSDSourceText* jsdsrc,
|
||||
{
|
||||
JSD_ASSERT_VALID_CONTEXT(jsdc);
|
||||
JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc);
|
||||
MOZ_ASSERT(ppBuf);
|
||||
MOZ_ASSERT(pLen);
|
||||
JS_ASSERT(ppBuf);
|
||||
JS_ASSERT(pLen);
|
||||
return jsd_GetSourceText(jsdc, jsdsrc, ppBuf, pLen);
|
||||
}
|
||||
|
||||
@ -473,7 +473,7 @@ JSD_PUBLIC_API(JSDSourceText*)
|
||||
JSD_NewSourceText(JSDContext* jsdc, const char* url)
|
||||
{
|
||||
JSD_ASSERT_VALID_CONTEXT(jsdc);
|
||||
MOZ_ASSERT(url);
|
||||
JS_ASSERT(url);
|
||||
return jsd_NewSourceText(jsdc, url);
|
||||
}
|
||||
|
||||
@ -508,7 +508,7 @@ JSD_AddFullSourceText(JSDContext* jsdc,
|
||||
const char* url)
|
||||
{
|
||||
JSD_ASSERT_VALID_CONTEXT(jsdc);
|
||||
MOZ_ASSERT(url);
|
||||
JS_ASSERT(url);
|
||||
return jsd_AddFullSourceText(jsdc, text, length, url);
|
||||
}
|
||||
|
||||
@ -769,9 +769,9 @@ JSD_EvaluateUCScriptInStackFrame(JSDContext* jsdc,
|
||||
const char *filename, unsigned lineno, JS::MutableHandleValue rval)
|
||||
{
|
||||
JSD_ASSERT_VALID_CONTEXT(jsdc);
|
||||
MOZ_ASSERT(bytes);
|
||||
MOZ_ASSERT(length);
|
||||
MOZ_ASSERT(filename);
|
||||
JS_ASSERT(bytes);
|
||||
JS_ASSERT(length);
|
||||
JS_ASSERT(filename);
|
||||
|
||||
return jsd_EvaluateUCScriptInStackFrame(jsdc, jsdthreadstate,jsdframe,
|
||||
bytes, length, filename, lineno,
|
||||
@ -787,9 +787,9 @@ JSD_AttemptUCScriptInStackFrame(JSDContext* jsdc,
|
||||
JS::MutableHandleValue rval)
|
||||
{
|
||||
JSD_ASSERT_VALID_CONTEXT(jsdc);
|
||||
MOZ_ASSERT(bytes);
|
||||
MOZ_ASSERT(length);
|
||||
MOZ_ASSERT(filename);
|
||||
JS_ASSERT(bytes);
|
||||
JS_ASSERT(length);
|
||||
JS_ASSERT(filename);
|
||||
|
||||
return jsd_EvaluateUCScriptInStackFrame(jsdc, jsdthreadstate,jsdframe,
|
||||
bytes, length, filename, lineno,
|
||||
@ -804,9 +804,9 @@ JSD_EvaluateScriptInStackFrame(JSDContext* jsdc,
|
||||
const char *filename, unsigned lineno, JS::MutableHandleValue rval)
|
||||
{
|
||||
JSD_ASSERT_VALID_CONTEXT(jsdc);
|
||||
MOZ_ASSERT(bytes);
|
||||
MOZ_ASSERT(length);
|
||||
MOZ_ASSERT(filename);
|
||||
JS_ASSERT(bytes);
|
||||
JS_ASSERT(length);
|
||||
JS_ASSERT(filename);
|
||||
|
||||
return jsd_EvaluateScriptInStackFrame(jsdc, jsdthreadstate,jsdframe,
|
||||
bytes, length,
|
||||
@ -821,9 +821,9 @@ JSD_AttemptScriptInStackFrame(JSDContext* jsdc,
|
||||
const char *filename, unsigned lineno, JS::MutableHandleValue rval)
|
||||
{
|
||||
JSD_ASSERT_VALID_CONTEXT(jsdc);
|
||||
MOZ_ASSERT(bytes);
|
||||
MOZ_ASSERT(length);
|
||||
MOZ_ASSERT(filename);
|
||||
JS_ASSERT(bytes);
|
||||
JS_ASSERT(length);
|
||||
JS_ASSERT(filename);
|
||||
|
||||
return jsd_EvaluateScriptInStackFrame(jsdc, jsdthreadstate,jsdframe,
|
||||
bytes, length,
|
||||
@ -1128,7 +1128,7 @@ JSD_IterateProperties(JSDContext* jsdc, JSDValue* jsdval, JSDProperty **iterp)
|
||||
{
|
||||
JSD_ASSERT_VALID_CONTEXT(jsdc);
|
||||
JSD_ASSERT_VALID_VALUE(jsdval);
|
||||
MOZ_ASSERT(iterp);
|
||||
JS_ASSERT(iterp);
|
||||
return jsd_IterateProperties(jsdc, jsdval, iterp);
|
||||
}
|
||||
|
||||
@ -1137,7 +1137,7 @@ JSD_GetValueProperty(JSDContext* jsdc, JSDValue* jsdval, JSString* name)
|
||||
{
|
||||
JSD_ASSERT_VALID_CONTEXT(jsdc);
|
||||
JSD_ASSERT_VALID_VALUE(jsdval);
|
||||
MOZ_ASSERT(name);
|
||||
JS_ASSERT(name);
|
||||
return jsd_GetValueProperty(jsdc, jsdval, name);
|
||||
}
|
||||
|
||||
@ -1299,7 +1299,7 @@ JSD_PUBLIC_API(JSDObject*)
|
||||
JSD_GetJSDObjectForJSObject(JSDContext* jsdc, JSObject* jsobj)
|
||||
{
|
||||
JSD_ASSERT_VALID_CONTEXT(jsdc);
|
||||
MOZ_ASSERT(jsobj);
|
||||
JS_ASSERT(jsobj);
|
||||
return jsd_GetJSDObjectForJSObject(jsdc, jsobj);
|
||||
}
|
||||
|
||||
|
@ -176,7 +176,7 @@ Resize(JSHashTable *ht, uint32_t newshift)
|
||||
JSHashEntry **oldbuckets, *he, *next, **hep;
|
||||
size_t nold = NBUCKETS(ht);
|
||||
|
||||
MOZ_ASSERT(newshift < JS_HASH_BITS);
|
||||
JS_ASSERT(newshift < JS_HASH_BITS);
|
||||
|
||||
nb = (size_t)1 << (JS_HASH_BITS - newshift);
|
||||
|
||||
@ -198,7 +198,7 @@ Resize(JSHashTable *ht, uint32_t newshift)
|
||||
|
||||
for (i = 0; nentries != 0; i++) {
|
||||
for (he = oldbuckets[i]; he; he = next) {
|
||||
MOZ_ASSERT(nentries != 0);
|
||||
JS_ASSERT(nentries != 0);
|
||||
--nentries;
|
||||
next = he->next;
|
||||
hep = BUCKET_HEAD(ht, he->keyHash);
|
||||
@ -339,7 +339,7 @@ JS_HashTableEnumerateEntries(JSHashTable *ht, JSHashEnumerator f, void *arg)
|
||||
for (bucket = ht->buckets; n != nlimit; ++bucket) {
|
||||
hep = bucket;
|
||||
while ((he = *hep) != nullptr) {
|
||||
MOZ_ASSERT(n < nlimit);
|
||||
JS_ASSERT(n < nlimit);
|
||||
rv = f(he, n, arg);
|
||||
n++;
|
||||
if (rv & HT_ENUMERATE_REMOVE) {
|
||||
@ -358,7 +358,7 @@ JS_HashTableEnumerateEntries(JSHashTable *ht, JSHashEnumerator f, void *arg)
|
||||
out:
|
||||
/* Shrink table if removal of entries made it underloaded */
|
||||
if (ht->nentries != nlimit) {
|
||||
MOZ_ASSERT(ht->nentries < nlimit);
|
||||
JS_ASSERT(ht->nentries < nlimit);
|
||||
nbuckets = NBUCKETS(ht);
|
||||
if (MINBUCKETS < nbuckets && ht->nentries < UNDERLOADED(nbuckets)) {
|
||||
newlog2 = CeilingLog2Size(ht->nentries);
|
||||
@ -366,7 +366,7 @@ out:
|
||||
newlog2 = MINBUCKETSLOG2;
|
||||
|
||||
/* Check that we really shrink the table. */
|
||||
MOZ_ASSERT(JS_HASH_BITS - ht->shift > newlog2);
|
||||
JS_ASSERT(JS_HASH_BITS - ht->shift > newlog2);
|
||||
Resize(ht, JS_HASH_BITS - newlog2);
|
||||
}
|
||||
}
|
||||
|
@ -50,13 +50,13 @@ class Latin1CharsZ : public mozilla::RangedPtr<unsigned char>
|
||||
Latin1CharsZ(char *aBytes, size_t aLength)
|
||||
: Base(reinterpret_cast<unsigned char *>(aBytes), aLength)
|
||||
{
|
||||
MOZ_ASSERT(aBytes[aLength] == '\0');
|
||||
JS_ASSERT(aBytes[aLength] == '\0');
|
||||
}
|
||||
|
||||
Latin1CharsZ(unsigned char *aBytes, size_t aLength)
|
||||
: Base(aBytes, aLength)
|
||||
{
|
||||
MOZ_ASSERT(aBytes[aLength] == '\0');
|
||||
JS_ASSERT(aBytes[aLength] == '\0');
|
||||
}
|
||||
|
||||
using Base::operator=;
|
||||
@ -91,13 +91,13 @@ class UTF8CharsZ : public mozilla::RangedPtr<unsigned char>
|
||||
UTF8CharsZ(char *aBytes, size_t aLength)
|
||||
: Base(reinterpret_cast<unsigned char *>(aBytes), aLength)
|
||||
{
|
||||
MOZ_ASSERT(aBytes[aLength] == '\0');
|
||||
JS_ASSERT(aBytes[aLength] == '\0');
|
||||
}
|
||||
|
||||
UTF8CharsZ(unsigned char *aBytes, size_t aLength)
|
||||
: Base(aBytes, aLength)
|
||||
{
|
||||
MOZ_ASSERT(aBytes[aLength] == '\0');
|
||||
JS_ASSERT(aBytes[aLength] == '\0');
|
||||
}
|
||||
|
||||
using Base::operator=;
|
||||
@ -136,7 +136,7 @@ class TwoByteCharsZ : public mozilla::RangedPtr<jschar>
|
||||
TwoByteCharsZ(jschar *chars, size_t length)
|
||||
: Base(chars, length)
|
||||
{
|
||||
MOZ_ASSERT(chars[length] == '\0');
|
||||
JS_ASSERT(chars[length] == '\0');
|
||||
}
|
||||
|
||||
using Base::operator=;
|
||||
|
@ -76,8 +76,8 @@ class SpecialId
|
||||
SpecialId(JSObject &obj)
|
||||
: bits_(uintptr_t(&obj) | TYPE_OBJECT)
|
||||
{
|
||||
MOZ_ASSERT(&obj != nullptr);
|
||||
MOZ_ASSERT((uintptr_t(&obj) & TYPE_MASK) == 0);
|
||||
JS_ASSERT(&obj != nullptr);
|
||||
JS_ASSERT((uintptr_t(&obj) & TYPE_MASK) == 0);
|
||||
}
|
||||
|
||||
bool isObject() const {
|
||||
@ -85,7 +85,7 @@ class SpecialId
|
||||
}
|
||||
|
||||
JSObject *toObject() const {
|
||||
MOZ_ASSERT(isObject());
|
||||
JS_ASSERT(isObject());
|
||||
return reinterpret_cast<JSObject *>(bits_ & ~TYPE_MASK);
|
||||
}
|
||||
|
||||
@ -93,7 +93,7 @@ class SpecialId
|
||||
|
||||
static SpecialId empty() {
|
||||
SpecialId sid(TYPE_OBJECT);
|
||||
MOZ_ASSERT(sid.isEmpty());
|
||||
JS_ASSERT(sid.isEmpty());
|
||||
return sid;
|
||||
}
|
||||
|
||||
@ -105,7 +105,7 @@ class SpecialId
|
||||
|
||||
static SpecialId voidId() {
|
||||
SpecialId sid(TYPE_VOID);
|
||||
MOZ_ASSERT(sid.isVoid());
|
||||
JS_ASSERT(sid.isVoid());
|
||||
return sid;
|
||||
}
|
||||
|
||||
@ -119,9 +119,9 @@ SPECIALID_TO_JSID(const SpecialId &sid)
|
||||
{
|
||||
jsid id;
|
||||
JSID_BITS(id) = sid.bits_;
|
||||
MOZ_ASSERT_IF(sid.isObject(), JSID_IS_OBJECT(id) && JSID_TO_OBJECT(id) == sid.toObject());
|
||||
MOZ_ASSERT_IF(sid.isVoid(), JSID_IS_VOID(id));
|
||||
MOZ_ASSERT_IF(sid.isEmpty(), JSID_IS_EMPTY(id));
|
||||
JS_ASSERT_IF(sid.isObject(), JSID_IS_OBJECT(id) && JSID_TO_OBJECT(id) == sid.toObject());
|
||||
JS_ASSERT_IF(sid.isVoid(), JSID_IS_VOID(id));
|
||||
JS_ASSERT_IF(sid.isEmpty(), JSID_IS_EMPTY(id));
|
||||
return id;
|
||||
}
|
||||
|
||||
@ -134,12 +134,12 @@ JSID_IS_SPECIAL(jsid id)
|
||||
static MOZ_ALWAYS_INLINE SpecialId
|
||||
JSID_TO_SPECIALID(jsid id)
|
||||
{
|
||||
MOZ_ASSERT(JSID_IS_SPECIAL(id));
|
||||
JS_ASSERT(JSID_IS_SPECIAL(id));
|
||||
if (JSID_IS_OBJECT(id))
|
||||
return SpecialId(*JSID_TO_OBJECT(id));
|
||||
if (JSID_IS_EMPTY(id))
|
||||
return SpecialId::empty();
|
||||
MOZ_ASSERT(JSID_IS_VOID(id));
|
||||
JS_ASSERT(JSID_IS_VOID(id));
|
||||
return SpecialId::voidId();
|
||||
}
|
||||
|
||||
|
@ -388,7 +388,7 @@ class JS_PUBLIC_API(ObjectPtr)
|
||||
ObjectPtr(JSObject *obj) : value(obj) {}
|
||||
|
||||
/* Always call finalize before the destructor. */
|
||||
~ObjectPtr() { MOZ_ASSERT(!value); }
|
||||
~ObjectPtr() { JS_ASSERT(!value); }
|
||||
|
||||
void finalize(JSRuntime *rt) {
|
||||
if (IsIncrementalBarrierNeeded(rt))
|
||||
@ -435,7 +435,7 @@ UnmarkGrayGCThingRecursively(void *thing, JSGCTraceKind kind);
|
||||
static MOZ_ALWAYS_INLINE void
|
||||
ExposeGCThingToActiveJS(void *thing, JSGCTraceKind kind)
|
||||
{
|
||||
MOZ_ASSERT(kind != JSTRACE_SHAPE);
|
||||
JS_ASSERT(kind != JSTRACE_SHAPE);
|
||||
|
||||
shadow::Runtime *rt = js::gc::GetGCThingRuntime(thing);
|
||||
#ifdef JSGC_GENERATIONAL
|
||||
|
@ -531,7 +531,7 @@ struct PointerHasher
|
||||
{
|
||||
typedef Key Lookup;
|
||||
static HashNumber hash(const Lookup &l) {
|
||||
MOZ_ASSERT(!JS::IsPoisonedPtr(l));
|
||||
JS_ASSERT(!JS::IsPoisonedPtr(l));
|
||||
size_t word = reinterpret_cast<size_t>(l) >> zeroBits;
|
||||
JS_STATIC_ASSERT(sizeof(HashNumber) == 4);
|
||||
#if JS_BITS_PER_WORD == 32
|
||||
@ -542,8 +542,8 @@ struct PointerHasher
|
||||
#endif
|
||||
}
|
||||
static bool match(const Key &k, const Lookup &l) {
|
||||
MOZ_ASSERT(!JS::IsPoisonedPtr(k));
|
||||
MOZ_ASSERT(!JS::IsPoisonedPtr(l));
|
||||
JS_ASSERT(!JS::IsPoisonedPtr(k));
|
||||
JS_ASSERT(!JS::IsPoisonedPtr(l));
|
||||
return k == l;
|
||||
}
|
||||
static void rekey(Key &k, const Key& newKey) {
|
||||
@ -701,7 +701,7 @@ class HashTableEntry
|
||||
}
|
||||
|
||||
void destroy() {
|
||||
MOZ_ASSERT(isLive());
|
||||
JS_ASSERT(isLive());
|
||||
mem.addr()->~T();
|
||||
}
|
||||
|
||||
@ -710,16 +710,16 @@ class HashTableEntry
|
||||
mozilla::Swap(mem, other->mem);
|
||||
}
|
||||
|
||||
T &get() { MOZ_ASSERT(isLive()); return *mem.addr(); }
|
||||
T &get() { JS_ASSERT(isLive()); return *mem.addr(); }
|
||||
|
||||
bool isFree() const { return keyHash == sFreeKey; }
|
||||
void clearLive() { MOZ_ASSERT(isLive()); keyHash = sFreeKey; mem.addr()->~T(); }
|
||||
void clearLive() { JS_ASSERT(isLive()); keyHash = sFreeKey; mem.addr()->~T(); }
|
||||
void clear() { if (isLive()) mem.addr()->~T(); keyHash = sFreeKey; }
|
||||
bool isRemoved() const { return keyHash == sRemovedKey; }
|
||||
void removeLive() { MOZ_ASSERT(isLive()); keyHash = sRemovedKey; mem.addr()->~T(); }
|
||||
void removeLive() { JS_ASSERT(isLive()); keyHash = sRemovedKey; mem.addr()->~T(); }
|
||||
bool isLive() const { return isLiveHash(keyHash); }
|
||||
void setCollision() { MOZ_ASSERT(isLive()); keyHash |= sCollisionBit; }
|
||||
void setCollision(HashNumber bit) { MOZ_ASSERT(isLive()); keyHash |= bit; }
|
||||
void setCollision() { JS_ASSERT(isLive()); keyHash |= sCollisionBit; }
|
||||
void setCollision(HashNumber bit) { JS_ASSERT(isLive()); keyHash |= bit; }
|
||||
void unsetCollision() { keyHash &= ~sCollisionBit; }
|
||||
bool hasCollision() const { return keyHash & sCollisionBit; }
|
||||
bool matchHash(HashNumber hn) { return (keyHash & ~sCollisionBit) == hn; }
|
||||
@ -728,10 +728,10 @@ class HashTableEntry
|
||||
template <class U>
|
||||
void setLive(HashNumber hn, U &&u)
|
||||
{
|
||||
MOZ_ASSERT(!isLive());
|
||||
JS_ASSERT(!isLive());
|
||||
keyHash = hn;
|
||||
new(mem.addr()) T(mozilla::Forward<U>(u));
|
||||
MOZ_ASSERT(isLive());
|
||||
JS_ASSERT(isLive());
|
||||
}
|
||||
};
|
||||
|
||||
@ -779,7 +779,7 @@ class HashTable : private AllocPolicy
|
||||
}
|
||||
|
||||
bool found() const {
|
||||
MOZ_ASSERT(generation == table_->generation());
|
||||
JS_ASSERT(generation == table_->generation());
|
||||
return entry_->isLive();
|
||||
}
|
||||
|
||||
@ -788,22 +788,22 @@ class HashTable : private AllocPolicy
|
||||
}
|
||||
|
||||
bool operator==(const Ptr &rhs) const {
|
||||
MOZ_ASSERT(found() && rhs.found());
|
||||
JS_ASSERT(found() && rhs.found());
|
||||
return entry_ == rhs.entry_;
|
||||
}
|
||||
|
||||
bool operator!=(const Ptr &rhs) const {
|
||||
MOZ_ASSERT(generation == table_->generation());
|
||||
JS_ASSERT(generation == table_->generation());
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
T &operator*() const {
|
||||
MOZ_ASSERT(generation == table_->generation());
|
||||
JS_ASSERT(generation == table_->generation());
|
||||
return entry_->get();
|
||||
}
|
||||
|
||||
T *operator->() const {
|
||||
MOZ_ASSERT(generation == table_->generation());
|
||||
JS_ASSERT(generation == table_->generation());
|
||||
return &entry_->get();
|
||||
}
|
||||
};
|
||||
@ -868,23 +868,23 @@ class HashTable : private AllocPolicy
|
||||
{}
|
||||
|
||||
bool empty() const {
|
||||
MOZ_ASSERT(generation == table_->generation());
|
||||
MOZ_ASSERT(mutationCount == table_->mutationCount);
|
||||
JS_ASSERT(generation == table_->generation());
|
||||
JS_ASSERT(mutationCount == table_->mutationCount);
|
||||
return cur == end;
|
||||
}
|
||||
|
||||
T &front() const {
|
||||
MOZ_ASSERT(validEntry);
|
||||
MOZ_ASSERT(!empty());
|
||||
MOZ_ASSERT(generation == table_->generation());
|
||||
MOZ_ASSERT(mutationCount == table_->mutationCount);
|
||||
JS_ASSERT(validEntry);
|
||||
JS_ASSERT(!empty());
|
||||
JS_ASSERT(generation == table_->generation());
|
||||
JS_ASSERT(mutationCount == table_->mutationCount);
|
||||
return cur->get();
|
||||
}
|
||||
|
||||
void popFront() {
|
||||
MOZ_ASSERT(!empty());
|
||||
MOZ_ASSERT(generation == table_->generation());
|
||||
MOZ_ASSERT(mutationCount == table_->mutationCount);
|
||||
JS_ASSERT(!empty());
|
||||
JS_ASSERT(generation == table_->generation());
|
||||
JS_ASSERT(mutationCount == table_->mutationCount);
|
||||
while (++cur < end && !cur->isLive())
|
||||
continue;
|
||||
#ifdef DEBUG
|
||||
@ -1078,7 +1078,7 @@ class HashTable : private AllocPolicy
|
||||
|
||||
MOZ_WARN_UNUSED_RESULT bool init(uint32_t length)
|
||||
{
|
||||
MOZ_ASSERT(!initialized());
|
||||
JS_ASSERT(!initialized());
|
||||
|
||||
// Reject all lengths whose initial computed capacity would exceed
|
||||
// sMaxCapacity. Round that maximum length down to the nearest power
|
||||
@ -1188,10 +1188,10 @@ class HashTable : private AllocPolicy
|
||||
|
||||
Entry &lookup(const Lookup &l, HashNumber keyHash, unsigned collisionBit) const
|
||||
{
|
||||
MOZ_ASSERT(isLiveHash(keyHash));
|
||||
MOZ_ASSERT(!(keyHash & sCollisionBit));
|
||||
MOZ_ASSERT(collisionBit == 0 || collisionBit == sCollisionBit);
|
||||
MOZ_ASSERT(table);
|
||||
JS_ASSERT(isLiveHash(keyHash));
|
||||
JS_ASSERT(!(keyHash & sCollisionBit));
|
||||
JS_ASSERT(collisionBit == 0 || collisionBit == sCollisionBit);
|
||||
JS_ASSERT(table);
|
||||
METER(stats.searches++);
|
||||
|
||||
// Compute the primary hash address.
|
||||
@ -1248,8 +1248,8 @@ class HashTable : private AllocPolicy
|
||||
// from entries, which allows more flexible Lookup/Key types.
|
||||
Entry &findFreeEntry(HashNumber keyHash)
|
||||
{
|
||||
MOZ_ASSERT(!(keyHash & sCollisionBit));
|
||||
MOZ_ASSERT(table);
|
||||
JS_ASSERT(!(keyHash & sCollisionBit));
|
||||
JS_ASSERT(table);
|
||||
METER(stats.searches++);
|
||||
|
||||
// We assume 'keyHash' has already been distributed.
|
||||
@ -1268,7 +1268,7 @@ class HashTable : private AllocPolicy
|
||||
DoubleHash dh = hash2(keyHash);
|
||||
|
||||
while(true) {
|
||||
MOZ_ASSERT(!entry->isRemoved());
|
||||
JS_ASSERT(!entry->isRemoved());
|
||||
entry->setCollision();
|
||||
|
||||
METER(stats.steps++);
|
||||
@ -1349,7 +1349,7 @@ class HashTable : private AllocPolicy
|
||||
|
||||
void remove(Entry &e)
|
||||
{
|
||||
MOZ_ASSERT(table);
|
||||
JS_ASSERT(table);
|
||||
METER(stats.removes++);
|
||||
|
||||
if (e.hasCollision()) {
|
||||
@ -1448,7 +1448,7 @@ class HashTable : private AllocPolicy
|
||||
|
||||
void finish()
|
||||
{
|
||||
MOZ_ASSERT(!entered);
|
||||
JS_ASSERT(!entered);
|
||||
|
||||
if (!table)
|
||||
return;
|
||||
@ -1463,31 +1463,31 @@ class HashTable : private AllocPolicy
|
||||
|
||||
Range all() const
|
||||
{
|
||||
MOZ_ASSERT(table);
|
||||
JS_ASSERT(table);
|
||||
return Range(*this, table, table + capacity());
|
||||
}
|
||||
|
||||
bool empty() const
|
||||
{
|
||||
MOZ_ASSERT(table);
|
||||
JS_ASSERT(table);
|
||||
return !entryCount;
|
||||
}
|
||||
|
||||
uint32_t count() const
|
||||
{
|
||||
MOZ_ASSERT(table);
|
||||
JS_ASSERT(table);
|
||||
return entryCount;
|
||||
}
|
||||
|
||||
uint32_t capacity() const
|
||||
{
|
||||
MOZ_ASSERT(table);
|
||||
JS_ASSERT(table);
|
||||
return JS_BIT(sHashBits - hashShift);
|
||||
}
|
||||
|
||||
uint32_t generation() const
|
||||
{
|
||||
MOZ_ASSERT(table);
|
||||
JS_ASSERT(table);
|
||||
return gen;
|
||||
}
|
||||
|
||||
@ -1527,9 +1527,9 @@ class HashTable : private AllocPolicy
|
||||
bool add(AddPtr &p, U &&u)
|
||||
{
|
||||
mozilla::ReentrancyGuard g(*this);
|
||||
MOZ_ASSERT(table);
|
||||
MOZ_ASSERT(!p.found());
|
||||
MOZ_ASSERT(!(p.keyHash & sCollisionBit));
|
||||
JS_ASSERT(table);
|
||||
JS_ASSERT(!p.found());
|
||||
JS_ASSERT(!(p.keyHash & sCollisionBit));
|
||||
|
||||
// Changing an entry from removed to live does not affect whether we
|
||||
// are overloaded and can be handled separately.
|
||||
@ -1561,7 +1561,7 @@ class HashTable : private AllocPolicy
|
||||
template <class U>
|
||||
void putNewInfallible(const Lookup &l, U &&u)
|
||||
{
|
||||
MOZ_ASSERT(table);
|
||||
JS_ASSERT(table);
|
||||
|
||||
HashNumber keyHash = prepareHash(l);
|
||||
Entry *entry = &findFreeEntry(keyHash);
|
||||
@ -1600,7 +1600,7 @@ class HashTable : private AllocPolicy
|
||||
#endif
|
||||
{
|
||||
mozilla::ReentrancyGuard g(*this);
|
||||
MOZ_ASSERT(prepareHash(l) == p.keyHash); // l has not been destroyed
|
||||
JS_ASSERT(prepareHash(l) == p.keyHash); // l has not been destroyed
|
||||
p.entry_ = &lookup(l, p.keyHash, sCollisionBit);
|
||||
}
|
||||
return p.found() || add(p, mozilla::Forward<U>(u));
|
||||
@ -1608,18 +1608,18 @@ class HashTable : private AllocPolicy
|
||||
|
||||
void remove(Ptr p)
|
||||
{
|
||||
MOZ_ASSERT(table);
|
||||
JS_ASSERT(table);
|
||||
mozilla::ReentrancyGuard g(*this);
|
||||
MOZ_ASSERT(p.found());
|
||||
JS_ASSERT(p.found());
|
||||
remove(*p.entry_);
|
||||
checkUnderloaded();
|
||||
}
|
||||
|
||||
void rekeyWithoutRehash(Ptr p, const Lookup &l, const Key &k)
|
||||
{
|
||||
MOZ_ASSERT(table);
|
||||
JS_ASSERT(table);
|
||||
mozilla::ReentrancyGuard g(*this);
|
||||
MOZ_ASSERT(p.found());
|
||||
JS_ASSERT(p.found());
|
||||
typename HashTableEntry<T>::NonConstT t(mozilla::Move(*p));
|
||||
HashPolicy::setKey(t, const_cast<Key &>(k));
|
||||
remove(*p.entry_);
|
||||
|
@ -86,13 +86,13 @@ struct Zone
|
||||
}
|
||||
|
||||
JSTracer *barrierTracer() {
|
||||
MOZ_ASSERT(needsBarrier_);
|
||||
MOZ_ASSERT(js::CurrentThreadCanAccessRuntime(runtime_));
|
||||
JS_ASSERT(needsBarrier_);
|
||||
JS_ASSERT(js::CurrentThreadCanAccessRuntime(runtime_));
|
||||
return barrierTracer_;
|
||||
}
|
||||
|
||||
JSRuntime *runtimeFromMainThread() const {
|
||||
MOZ_ASSERT(js::CurrentThreadCanAccessRuntime(runtime_));
|
||||
JS_ASSERT(js::CurrentThreadCanAccessRuntime(runtime_));
|
||||
return runtime_;
|
||||
}
|
||||
|
||||
@ -116,7 +116,7 @@ namespace gc {
|
||||
static MOZ_ALWAYS_INLINE uintptr_t *
|
||||
GetGCThingMarkBitmap(const void *thing)
|
||||
{
|
||||
MOZ_ASSERT(thing);
|
||||
JS_ASSERT(thing);
|
||||
uintptr_t addr = uintptr_t(thing);
|
||||
addr &= ~js::gc::ChunkMask;
|
||||
addr |= js::gc::ChunkMarkBitmapOffset;
|
||||
@ -126,7 +126,7 @@ GetGCThingMarkBitmap(const void *thing)
|
||||
static MOZ_ALWAYS_INLINE JS::shadow::Runtime *
|
||||
GetGCThingRuntime(const void *thing)
|
||||
{
|
||||
MOZ_ASSERT(thing);
|
||||
JS_ASSERT(thing);
|
||||
uintptr_t addr = uintptr_t(thing);
|
||||
addr &= ~js::gc::ChunkMask;
|
||||
addr |= js::gc::ChunkRuntimeOffset;
|
||||
@ -139,7 +139,7 @@ GetGCThingMarkWordAndMask(const void *thing, uint32_t color,
|
||||
{
|
||||
uintptr_t addr = uintptr_t(thing);
|
||||
size_t bit = (addr & js::gc::ChunkMask) / js::gc::CellSize + color;
|
||||
MOZ_ASSERT(bit < js::gc::ChunkMarkBitmapBits);
|
||||
JS_ASSERT(bit < js::gc::ChunkMarkBitmapBits);
|
||||
uintptr_t *bitmap = GetGCThingMarkBitmap(thing);
|
||||
const uintptr_t nbits = sizeof(*bitmap) * CHAR_BIT;
|
||||
*maskp = uintptr_t(1) << (bit % nbits);
|
||||
@ -173,7 +173,7 @@ namespace JS {
|
||||
static MOZ_ALWAYS_INLINE Zone *
|
||||
GetGCThingZone(void *thing)
|
||||
{
|
||||
MOZ_ASSERT(thing);
|
||||
JS_ASSERT(thing);
|
||||
return js::gc::GetGCThingArena(thing)->zone;
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ JSID_IS_STRING(jsid id)
|
||||
static MOZ_ALWAYS_INLINE JSString *
|
||||
JSID_TO_STRING(jsid id)
|
||||
{
|
||||
MOZ_ASSERT(JSID_IS_STRING(id));
|
||||
JS_ASSERT(JSID_IS_STRING(id));
|
||||
return (JSString *)JSID_BITS(id);
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ JSID_IS_INT(jsid id)
|
||||
static MOZ_ALWAYS_INLINE int32_t
|
||||
JSID_TO_INT(jsid id)
|
||||
{
|
||||
MOZ_ASSERT(JSID_IS_INT(id));
|
||||
JS_ASSERT(JSID_IS_INT(id));
|
||||
return ((uint32_t)JSID_BITS(id)) >> 1;
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ static MOZ_ALWAYS_INLINE jsid
|
||||
INT_TO_JSID(int32_t i)
|
||||
{
|
||||
jsid id;
|
||||
MOZ_ASSERT(INT_FITS_IN_JSID(i));
|
||||
JS_ASSERT(INT_FITS_IN_JSID(i));
|
||||
JSID_BITS(id) = ((i << 1) | JSID_TYPE_INT);
|
||||
return id;
|
||||
}
|
||||
@ -106,7 +106,7 @@ JSID_IS_OBJECT(jsid id)
|
||||
static MOZ_ALWAYS_INLINE JSObject *
|
||||
JSID_TO_OBJECT(jsid id)
|
||||
{
|
||||
MOZ_ASSERT(JSID_IS_OBJECT(id));
|
||||
JS_ASSERT(JSID_IS_OBJECT(id));
|
||||
return (JSObject *)(JSID_BITS(id) & ~(size_t)JSID_TYPE_MASK);
|
||||
}
|
||||
|
||||
@ -114,8 +114,8 @@ static MOZ_ALWAYS_INLINE jsid
|
||||
OBJECT_TO_JSID(JSObject *obj)
|
||||
{
|
||||
jsid id;
|
||||
MOZ_ASSERT(obj != nullptr);
|
||||
MOZ_ASSERT(((size_t)obj & JSID_TYPE_MASK) == 0);
|
||||
JS_ASSERT(obj != nullptr);
|
||||
JS_ASSERT(((size_t)obj & JSID_TYPE_MASK) == 0);
|
||||
JSID_BITS(id) = ((size_t)obj | JSID_TYPE_OBJECT);
|
||||
return id;
|
||||
}
|
||||
@ -135,7 +135,7 @@ JSID_TO_GCTHING(jsid id)
|
||||
static MOZ_ALWAYS_INLINE bool
|
||||
JSID_IS_VOID(const jsid id)
|
||||
{
|
||||
MOZ_ASSERT_IF(((size_t)JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_VOID,
|
||||
JS_ASSERT_IF(((size_t)JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_VOID,
|
||||
JSID_BITS(id) == JSID_TYPE_VOID);
|
||||
return ((size_t)JSID_BITS(id) == JSID_TYPE_VOID);
|
||||
}
|
||||
|
@ -51,16 +51,16 @@ class ProfileEntry
|
||||
// were marked as volatile as well.
|
||||
|
||||
bool js() const volatile {
|
||||
MOZ_ASSERT_IF(sp == nullptr, script_ != nullptr);
|
||||
JS_ASSERT_IF(sp == nullptr, script_ != nullptr);
|
||||
return sp == nullptr;
|
||||
}
|
||||
|
||||
uint32_t line() const volatile { MOZ_ASSERT(!js()); return idx; }
|
||||
JSScript *script() const volatile { MOZ_ASSERT(js()); return script_; }
|
||||
uint32_t line() const volatile { JS_ASSERT(!js()); return idx; }
|
||||
JSScript *script() const volatile { JS_ASSERT(js()); return script_; }
|
||||
void *stackAddress() const volatile { return sp; }
|
||||
const char *label() const volatile { return string; }
|
||||
|
||||
void setLine(uint32_t aLine) volatile { MOZ_ASSERT(!js()); idx = aLine; }
|
||||
void setLine(uint32_t aLine) volatile { JS_ASSERT(!js()); idx = aLine; }
|
||||
void setLabel(const char *aString) volatile { string = aString; }
|
||||
void setStackAddress(void *aSp) volatile { sp = aSp; }
|
||||
void setScript(JSScript *aScript) volatile { script_ = aScript; }
|
||||
|
@ -238,7 +238,7 @@ class Heap : public js::HeapBase<T>
|
||||
}
|
||||
|
||||
void set(T newPtr) {
|
||||
MOZ_ASSERT(!js::GCMethods<T>::poisoned(newPtr));
|
||||
JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));
|
||||
if (js::GCMethods<T>::needsPostBarrier(newPtr)) {
|
||||
ptr = newPtr;
|
||||
post();
|
||||
@ -252,7 +252,7 @@ class Heap : public js::HeapBase<T>
|
||||
|
||||
private:
|
||||
void init(T newPtr) {
|
||||
MOZ_ASSERT(!js::GCMethods<T>::poisoned(newPtr));
|
||||
JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));
|
||||
ptr = newPtr;
|
||||
if (js::GCMethods<T>::needsPostBarrier(ptr))
|
||||
post();
|
||||
@ -260,7 +260,7 @@ class Heap : public js::HeapBase<T>
|
||||
|
||||
void post() {
|
||||
#ifdef JSGC_GENERATIONAL
|
||||
MOZ_ASSERT(js::GCMethods<T>::needsPostBarrier(ptr));
|
||||
JS_ASSERT(js::GCMethods<T>::needsPostBarrier(ptr));
|
||||
js::GCMethods<T>::postBarrier(&ptr);
|
||||
#endif
|
||||
}
|
||||
@ -330,25 +330,25 @@ class TenuredHeap : public js::HeapBase<T>
|
||||
bool operator!=(const TenuredHeap<T> &other) { return bits != other.bits; }
|
||||
|
||||
void setPtr(T newPtr) {
|
||||
MOZ_ASSERT((reinterpret_cast<uintptr_t>(newPtr) & flagsMask) == 0);
|
||||
MOZ_ASSERT(!js::GCMethods<T>::poisoned(newPtr));
|
||||
JS_ASSERT((reinterpret_cast<uintptr_t>(newPtr) & flagsMask) == 0);
|
||||
JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));
|
||||
if (newPtr)
|
||||
AssertGCThingMustBeTenured(newPtr);
|
||||
bits = (bits & flagsMask) | reinterpret_cast<uintptr_t>(newPtr);
|
||||
}
|
||||
|
||||
void setFlags(uintptr_t flagsToSet) {
|
||||
MOZ_ASSERT((flagsToSet & ~flagsMask) == 0);
|
||||
JS_ASSERT((flagsToSet & ~flagsMask) == 0);
|
||||
bits |= flagsToSet;
|
||||
}
|
||||
|
||||
void unsetFlags(uintptr_t flagsToUnset) {
|
||||
MOZ_ASSERT((flagsToUnset & ~flagsMask) == 0);
|
||||
JS_ASSERT((flagsToUnset & ~flagsMask) == 0);
|
||||
bits &= ~flagsToUnset;
|
||||
}
|
||||
|
||||
bool hasFlag(uintptr_t flag) const {
|
||||
MOZ_ASSERT((flag & ~flagsMask) == 0);
|
||||
JS_ASSERT((flag & ~flagsMask) == 0);
|
||||
return (bits & flag) != 0;
|
||||
}
|
||||
|
||||
@ -529,7 +529,7 @@ class MOZ_STACK_CLASS MutableHandle : public js::MutableHandleBase<T>
|
||||
|
||||
public:
|
||||
void set(T v) {
|
||||
MOZ_ASSERT(!js::GCMethods<T>::poisoned(v));
|
||||
JS_ASSERT(!js::GCMethods<T>::poisoned(v));
|
||||
*ptr = v;
|
||||
}
|
||||
|
||||
@ -695,7 +695,7 @@ class MOZ_STACK_CLASS Rooted : public js::RootedBase<T>
|
||||
this->prev = *stack;
|
||||
*stack = reinterpret_cast<Rooted<void*>*>(this);
|
||||
|
||||
MOZ_ASSERT(!js::GCMethods<T>::poisoned(ptr));
|
||||
JS_ASSERT(!js::GCMethods<T>::poisoned(ptr));
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -775,7 +775,7 @@ class MOZ_STACK_CLASS Rooted : public js::RootedBase<T>
|
||||
// using MSVC, see bug 915735 for more details.
|
||||
#ifdef JSGC_TRACK_EXACT_ROOTS
|
||||
~Rooted() {
|
||||
MOZ_ASSERT(*stack == reinterpret_cast<Rooted<void*>*>(this));
|
||||
JS_ASSERT(*stack == reinterpret_cast<Rooted<void*>*>(this));
|
||||
*stack = prev;
|
||||
}
|
||||
#endif
|
||||
@ -796,7 +796,7 @@ class MOZ_STACK_CLASS Rooted : public js::RootedBase<T>
|
||||
const T &get() const { return ptr; }
|
||||
|
||||
T &operator=(T value) {
|
||||
MOZ_ASSERT(!js::GCMethods<T>::poisoned(value));
|
||||
JS_ASSERT(!js::GCMethods<T>::poisoned(value));
|
||||
ptr = value;
|
||||
return ptr;
|
||||
}
|
||||
@ -807,7 +807,7 @@ class MOZ_STACK_CLASS Rooted : public js::RootedBase<T>
|
||||
}
|
||||
|
||||
void set(T value) {
|
||||
MOZ_ASSERT(!js::GCMethods<T>::poisoned(value));
|
||||
JS_ASSERT(!js::GCMethods<T>::poisoned(value));
|
||||
ptr = value;
|
||||
}
|
||||
|
||||
@ -887,7 +887,7 @@ class SkipRoot
|
||||
|
||||
public:
|
||||
~SkipRoot() {
|
||||
MOZ_ASSERT(*stack == this);
|
||||
JS_ASSERT(*stack == this);
|
||||
*stack = prev;
|
||||
}
|
||||
|
||||
@ -1021,13 +1021,13 @@ class FakeRooted : public RootedBase<T>
|
||||
const T &get() const { return ptr; }
|
||||
|
||||
FakeRooted<T> &operator=(T value) {
|
||||
MOZ_ASSERT(!GCMethods<T>::poisoned(value));
|
||||
JS_ASSERT(!GCMethods<T>::poisoned(value));
|
||||
ptr = value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
FakeRooted<T> &operator=(const FakeRooted<T> &other) {
|
||||
MOZ_ASSERT(!GCMethods<T>::poisoned(other.ptr));
|
||||
JS_ASSERT(!GCMethods<T>::poisoned(other.ptr));
|
||||
ptr = other.ptr;
|
||||
return *this;
|
||||
}
|
||||
@ -1057,7 +1057,7 @@ class FakeMutableHandle : public js::MutableHandleBase<T>
|
||||
}
|
||||
|
||||
void set(T v) {
|
||||
MOZ_ASSERT(!js::GCMethods<T>::poisoned(v));
|
||||
JS_ASSERT(!js::GCMethods<T>::poisoned(v));
|
||||
*ptr = v;
|
||||
}
|
||||
|
||||
@ -1261,7 +1261,7 @@ class PersistentRooted : private mozilla::LinkedListElement<PersistentRooted<T>
|
||||
const T &get() const { return ptr; }
|
||||
|
||||
T &operator=(T value) {
|
||||
MOZ_ASSERT(!js::GCMethods<T>::poisoned(value));
|
||||
JS_ASSERT(!js::GCMethods<T>::poisoned(value));
|
||||
ptr = value;
|
||||
return ptr;
|
||||
}
|
||||
@ -1272,7 +1272,7 @@ class PersistentRooted : private mozilla::LinkedListElement<PersistentRooted<T>
|
||||
}
|
||||
|
||||
void set(T value) {
|
||||
MOZ_ASSERT(!js::GCMethods<T>::poisoned(value));
|
||||
JS_ASSERT(!js::GCMethods<T>::poisoned(value));
|
||||
ptr = value;
|
||||
}
|
||||
|
||||
|
@ -42,6 +42,16 @@ namespace js {}
|
||||
|
||||
#define JS_ASSERT(expr) MOZ_ASSERT(expr)
|
||||
#define JS_ASSERT_IF(cond, expr) MOZ_ASSERT_IF(cond, expr)
|
||||
#define JS_ALWAYS_TRUE(expr) MOZ_ALWAYS_TRUE(expr)
|
||||
#define JS_ALWAYS_FALSE(expr) MOZ_ALWAYS_FALSE(expr)
|
||||
|
||||
#if defined(JS_DEBUG)
|
||||
# define JS_DIAGNOSTICS_ASSERT(expr) MOZ_ASSERT(expr)
|
||||
#elif defined(JS_CRASH_DIAGNOSTICS)
|
||||
# define JS_DIAGNOSTICS_ASSERT(expr) do { if (!(expr)) MOZ_CRASH(); } while(0)
|
||||
#else
|
||||
# define JS_DIAGNOSTICS_ASSERT(expr) ((void) 0)
|
||||
#endif
|
||||
|
||||
#define JS_STATIC_ASSERT(cond) static_assert(cond, "JS_STATIC_ASSERT")
|
||||
#define JS_STATIC_ASSERT_IF(cond, expr) MOZ_STATIC_ASSERT_IF(cond, expr, "JS_STATIC_ASSERT_IF")
|
||||
|
@ -11,7 +11,6 @@
|
||||
#ifndef jsutil_h
|
||||
#define jsutil_h
|
||||
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/Compiler.h"
|
||||
#include "mozilla/GuardObjects.h"
|
||||
|
||||
@ -19,17 +18,6 @@
|
||||
|
||||
#include "js/Utility.h"
|
||||
|
||||
#define JS_ALWAYS_TRUE(expr) MOZ_ALWAYS_TRUE(expr)
|
||||
#define JS_ALWAYS_FALSE(expr) MOZ_ALWAYS_FALSE(expr)
|
||||
|
||||
#if defined(JS_DEBUG)
|
||||
# define JS_DIAGNOSTICS_ASSERT(expr) MOZ_ASSERT(expr)
|
||||
#elif defined(JS_CRASH_DIAGNOSTICS)
|
||||
# define JS_DIAGNOSTICS_ASSERT(expr) do { if (MOZ_UNLIKELY(!(expr)) MOZ_CRASH(); } while(0)
|
||||
#else
|
||||
# define JS_DIAGNOSTICS_ASSERT(expr) ((void) 0)
|
||||
#endif
|
||||
|
||||
static MOZ_ALWAYS_INLINE void *
|
||||
js_memcpy(void *dst_, const void *src_, size_t len)
|
||||
{
|
||||
|
@ -392,8 +392,8 @@ CloneNonReflectorsRead(JSContext *cx, JSStructuredCloneReader *reader, uint32_t
|
||||
|
||||
if (!JS_WrapObject(cx, &reflector))
|
||||
return nullptr;
|
||||
MOZ_ASSERT(WrapperFactory::IsXrayWrapper(reflector) ||
|
||||
IsReflector(reflector));
|
||||
JS_ASSERT(WrapperFactory::IsXrayWrapper(reflector) ||
|
||||
IsReflector(reflector));
|
||||
|
||||
return reflector;
|
||||
}
|
||||
|
@ -382,8 +382,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
static_assert(sizeof(mStack[0]) == sizeof(js::ProfileEntry),
|
||||
"mStack must be binary compatible with js::ProfileEntry.");
|
||||
JS_STATIC_ASSERT(sizeof(mStack[0]) == sizeof(js::ProfileEntry));
|
||||
js::SetRuntimeProfilingStack(runtime,
|
||||
(js::ProfileEntry*) mStack,
|
||||
(uint32_t*) &mStackPointer,
|
||||
|
@ -548,8 +548,7 @@ CycleCollectedJSRuntime::DescribeGCThing(bool aIsMarked, void* aThing,
|
||||
"BaseShape",
|
||||
"TypeObject",
|
||||
};
|
||||
static_assert(MOZ_ARRAY_LENGTH(trace_types) == JSTRACE_LAST + 1,
|
||||
"Length of trace_types should match the number of cases of JSGCTraceKind.");
|
||||
JS_STATIC_ASSERT(MOZ_ARRAY_LENGTH(trace_types) == JSTRACE_LAST + 1);
|
||||
JS_snprintf(name, sizeof(name), "JS %s", trace_types[aTraceKind]);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user