Bug 807151 - Unexport |mozilla| from the |js| namespace; r=Waldo

Clang does not want to allow js::ion::Range and mozilla::Range simultaneously
when we have a |namespace js { using namespace mozilla; }| declaration.
This commit is contained in:
Terrence Cole 2012-11-06 17:35:18 -08:00
Родитель 49ea6392ea
Коммит cd906e6a9c
77 изменённых файлов: 165 добавлений и 76 удалений

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

@ -122,7 +122,7 @@ class HashTable : private AllocPolicy
{ {
friend class HashTable; friend class HashTable;
HashNumber keyHash; HashNumber keyHash;
DebugOnly<uint64_t> mutationCount; mozilla::DebugOnly<uint64_t> mutationCount;
AddPtr(Entry &entry, HashNumber hn) : Ptr(entry), keyHash(hn) {} AddPtr(Entry &entry, HashNumber hn) : Ptr(entry), keyHash(hn) {}
public: public:
@ -147,7 +147,7 @@ class HashTable : private AllocPolicy
} }
Entry *cur, *end; Entry *cur, *end;
DebugOnly<bool> validEntry; mozilla::DebugOnly<bool> validEntry;
public: public:
Range() : cur(NULL), end(NULL), validEntry(false) {} Range() : cur(NULL), end(NULL), validEntry(false) {}
@ -268,8 +268,8 @@ class HashTable : private AllocPolicy
#endif #endif
friend class js::ReentrancyGuard; friend class js::ReentrancyGuard;
mutable DebugOnly<bool> entered; mutable mozilla::DebugOnly<bool> entered;
DebugOnly<uint64_t> mutationCount; mozilla::DebugOnly<uint64_t> mutationCount;
/* The default initial capacity is 16, but you can ask for as small as 4. */ /* The default initial capacity is 16, but you can ask for as small as 4. */
static const unsigned sMinSizeLog2 = 2; static const unsigned sMinSizeLog2 = 2;

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

@ -35,7 +35,6 @@ namespace js {
/* The private namespace is a superset of the public/shared namespaces. */ /* The private namespace is a superset of the public/shared namespaces. */
using namespace JS; using namespace JS;
using namespace mozilla;
} /* namespace js */ } /* namespace js */

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

@ -242,7 +242,7 @@ class Vector : private AllocPolicy
size_t mReserved; /* Max elements of reserved or used space in this vector. */ size_t mReserved; /* Max elements of reserved or used space in this vector. */
#endif #endif
AlignedStorage<sInlineBytes> storage; mozilla::AlignedStorage<sInlineBytes> storage;
#ifdef DEBUG #ifdef DEBUG
friend class ReentrancyGuard; friend class ReentrancyGuard;
@ -431,7 +431,7 @@ class Vector : private AllocPolicy
internalAppendN(t, n); internalAppendN(t, n);
} }
template <class U> void infallibleAppend(const U *begin, const U *end) { template <class U> void infallibleAppend(const U *begin, const U *end) {
internalAppend(begin, PointerRangeSize(begin, end)); internalAppend(begin, mozilla::PointerRangeSize(begin, end));
} }
template <class U> void infallibleAppend(const U *begin, size_t length) { template <class U> void infallibleAppend(const U *begin, size_t length) {
internalAppend(begin, length); internalAppend(begin, length);
@ -862,7 +862,7 @@ JS_ALWAYS_INLINE bool
Vector<T,N,AP>::append(const U *insBegin, const U *insEnd) Vector<T,N,AP>::append(const U *insBegin, const U *insEnd)
{ {
REENTRANCY_GUARD_ET_AL; REENTRANCY_GUARD_ET_AL;
size_t needed = PointerRangeSize(insBegin, insEnd); size_t needed = mozilla::PointerRangeSize(insBegin, insEnd);
if (mLength + needed > mCapacity && !growStorageBy(needed)) if (mLength + needed > mCapacity && !growStorageBy(needed))
return false; return false;

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

@ -126,7 +126,7 @@ public:
Call call() Call call()
{ {
js::DebugOnly<DataLabelPtr> label = moveWithPatch(ImmPtr(0), scratchRegister); mozilla::DebugOnly<DataLabelPtr> label = moveWithPatch(ImmPtr(0), scratchRegister);
Call result = Call(m_assembler.call(scratchRegister), Call::Linkable); Call result = Call(m_assembler.call(scratchRegister), Call::Linkable);
ASSERT(differenceBetween(label, result) == REPTACH_OFFSET_CALL_R11); ASSERT(differenceBetween(label, result) == REPTACH_OFFSET_CALL_R11);
return result; return result;
@ -134,7 +134,7 @@ public:
Call tailRecursiveCall() Call tailRecursiveCall()
{ {
js::DebugOnly<DataLabelPtr> label = moveWithPatch(ImmPtr(0), scratchRegister); mozilla::DebugOnly<DataLabelPtr> label = moveWithPatch(ImmPtr(0), scratchRegister);
Jump newJump = Jump(m_assembler.jmp_r(scratchRegister)); Jump newJump = Jump(m_assembler.jmp_r(scratchRegister));
ASSERT(differenceBetween(label, newJump) == REPTACH_OFFSET_CALL_R11); ASSERT(differenceBetween(label, newJump) == REPTACH_OFFSET_CALL_R11);
return Call::fromTailJump(newJump); return Call::fromTailJump(newJump);
@ -143,7 +143,7 @@ public:
Call makeTailRecursiveCall(Jump oldJump) Call makeTailRecursiveCall(Jump oldJump)
{ {
oldJump.link(this); oldJump.link(this);
js::DebugOnly<DataLabelPtr> label = moveWithPatch(ImmPtr(0), scratchRegister); mozilla::DebugOnly<DataLabelPtr> label = moveWithPatch(ImmPtr(0), scratchRegister);
Jump newJump = Jump(m_assembler.jmp_r(scratchRegister)); Jump newJump = Jump(m_assembler.jmp_r(scratchRegister));
ASSERT(differenceBetween(label, newJump) == REPTACH_OFFSET_CALL_R11); ASSERT(differenceBetween(label, newJump) == REPTACH_OFFSET_CALL_R11);
return Call::fromTailJump(newJump); return Call::fromTailJump(newJump);

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

@ -17,6 +17,9 @@
using namespace js; using namespace js;
using mozilla::AddToHash;
using mozilla::HashString;
// We should be able to assert this for *any* fp->scopeChain(). // We should be able to assert this for *any* fp->scopeChain().
static void static void
AssertInnerizedScopeChain(JSContext *cx, JSObject &scopeobj) AssertInnerizedScopeChain(JSContext *cx, JSObject &scopeobj)

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

@ -25,6 +25,8 @@
using namespace js; using namespace js;
using mozilla::ArrayLength;
/* Thread-unsafe error management */ /* Thread-unsafe error management */
static char gLastError[2000]; static char gLastError[2000];

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

@ -17,6 +17,8 @@
using namespace js; using namespace js;
using namespace js::types; using namespace js::types;
using mozilla::ArrayLength;
class RegExpMatchBuilder class RegExpMatchBuilder
{ {
JSContext * const cx; JSContext * const cx;

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

@ -21,6 +21,8 @@
using namespace js; using namespace js;
using namespace JS; using namespace JS;
using mozilla::ArrayLength;
static JSBool static JSBool
GetBuildConfiguration(JSContext *cx, unsigned argc, jsval *vp) GetBuildConfiguration(JSContext *cx, unsigned argc, jsval *vp)
{ {

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

@ -64,7 +64,7 @@ class BumpChunk
void setBump(void *ptr) { void setBump(void *ptr) {
JS_ASSERT(bumpBase() <= ptr); JS_ASSERT(bumpBase() <= ptr);
JS_ASSERT(ptr <= limit); JS_ASSERT(ptr <= limit);
DebugOnly<char *> prevBump = bump; mozilla::DebugOnly<char *> prevBump = bump;
bump = static_cast<char *>(ptr); bump = static_cast<char *>(ptr);
#ifdef DEBUG #ifdef DEBUG
JS_ASSERT(contains(prevBump)); JS_ASSERT(contains(prevBump));
@ -225,7 +225,7 @@ class LifoAlloc
if (latest && (result = latest->tryAlloc(n))) if (latest && (result = latest->tryAlloc(n)))
return result; return result;
DebugOnly<BumpChunk *> chunk = getOrCreateChunk(n); mozilla::DebugOnly<BumpChunk *> chunk = getOrCreateChunk(n);
JS_ASSERT(chunk); JS_ASSERT(chunk);
return latest->allocInfallible(n); return latest->allocInfallible(n);

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

@ -57,6 +57,8 @@ using namespace js;
using namespace js::gc; using namespace js::gc;
using namespace js::frontend; using namespace js::frontend;
using mozilla::DebugOnly;
static bool static bool
SetSrcNoteOffset(JSContext *cx, BytecodeEmitter *bce, unsigned index, unsigned which, ptrdiff_t offset); SetSrcNoteOffset(JSContext *cx, BytecodeEmitter *bce, unsigned index, unsigned which, ptrdiff_t offset);

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

@ -19,6 +19,8 @@
#include "ion/IonCode.h" #include "ion/IonCode.h"
#include "vm/String-inl.h" #include "vm/String-inl.h"
using mozilla::DebugOnly;
void * const js::NullPtr::constNullValue = NULL; void * const js::NullPtr::constNullValue = NULL;
/* /*

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

@ -801,15 +801,11 @@ public:
/* /*
* AssertCanGC will assert if it is called inside of an AutoAssertNoGC region. * AssertCanGC will assert if it is called inside of an AutoAssertNoGC region.
*/ */
#ifdef DEBUG
JS_ALWAYS_INLINE void JS_ALWAYS_INLINE void
AssertCanGC() AssertCanGC()
{ {
JS_ASSERT(!InNoGCScope()); JS_ASSERT(!InNoGCScope());
} }
#else
# define AssertCanGC()
#endif
#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE) #if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)
extern void extern void

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

@ -123,7 +123,7 @@ class BailoutClosure
BailoutFrameGuard bfg; BailoutFrameGuard bfg;
}; };
Maybe<Guards> guards_; mozilla::Maybe<Guards> guards_;
StackFrame *entryfp_; StackFrame *entryfp_;
jsbytecode *bailoutPc_; jsbytecode *bailoutPc_;

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

@ -19,6 +19,8 @@
using namespace js; using namespace js;
using namespace js::ion; using namespace js::ion;
using mozilla::DebugOnly;
namespace js { namespace js {
namespace ion { namespace ion {

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

@ -41,7 +41,7 @@ class InlineForwardList : protected InlineForwardListNode<T>
typedef InlineForwardListNode<T> Node; typedef InlineForwardListNode<T> Node;
Node *tail_; Node *tail_;
DebugOnly<int> modifyCount_; mozilla::DebugOnly<int> modifyCount_;
InlineForwardList<T> *thisFromConstructor() { InlineForwardList<T> *thisFromConstructor() {
return this; return this;
@ -183,7 +183,7 @@ private:
#ifdef DEBUG #ifdef DEBUG
const InlineForwardList<T> *owner_; const InlineForwardList<T> *owner_;
#endif #endif
DebugOnly<int> modifyCount_; mozilla::DebugOnly<int> modifyCount_;
}; };
template <typename T> class InlineList; template <typename T> class InlineList;

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

@ -23,6 +23,8 @@
using namespace js; using namespace js;
using namespace js::ion; using namespace js::ion;
using mozilla::DebugOnly;
IonBuilder::IonBuilder(JSContext *cx, TempAllocator *temp, MIRGraph *graph, IonBuilder::IonBuilder(JSContext *cx, TempAllocator *temp, MIRGraph *graph,
TypeOracle *oracle, CompileInfo *info, size_t inliningDepth, uint32 loopDepth) TypeOracle *oracle, CompileInfo *info, size_t inliningDepth, uint32 loopDepth)
: MIRGenerator(cx->compartment, temp, graph, info), : MIRGenerator(cx->compartment, temp, graph, info),

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

@ -22,6 +22,8 @@
using namespace js; using namespace js;
using namespace js::ion; using namespace js::ion;
using mozilla::DebugOnly;
void void
CodeLocationJump::repoint(IonCode *code, MacroAssembler *masm) CodeLocationJump::repoint(IonCode *code, MacroAssembler *masm)
{ {

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

@ -57,7 +57,7 @@ class IonCacheName;
struct TypedOrValueRegisterSpace struct TypedOrValueRegisterSpace
{ {
AlignedStorage2<TypedOrValueRegister> data_; mozilla::AlignedStorage2<TypedOrValueRegister> data_;
TypedOrValueRegister &data() { TypedOrValueRegister &data() {
return *data_.addr(); return *data_.addr();
} }
@ -68,7 +68,7 @@ struct TypedOrValueRegisterSpace
struct ConstantOrRegisterSpace struct ConstantOrRegisterSpace
{ {
AlignedStorage2<ConstantOrRegister> data_; mozilla::AlignedStorage2<ConstantOrRegister> data_;
ConstantOrRegister &data() { ConstantOrRegister &data() {
return *data_.addr(); return *data_.addr();
} }

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

@ -107,7 +107,7 @@ class SafepointIndex
uint32 safepointOffset_; uint32 safepointOffset_;
}; };
DebugOnly<bool> resolved; mozilla::DebugOnly<bool> resolved;
public: public:
SafepointIndex(uint32 displacement, LSafepoint *safepoint) SafepointIndex(uint32 displacement, LSafepoint *safepoint)

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

@ -25,7 +25,7 @@
namespace js { namespace js {
namespace ion { namespace ion {
// The public entrypoint for emitting assembly. Note that a MacroAssembler can // The public entrypoint for emitting assembly. Note that a MacroAssembler can
// use cx->lifoAlloc, so take care not to interleave masm use with other // use cx->lifoAlloc, so take care not to interleave masm use with other
// lifoAlloc use if one will be destroyed before the other. // lifoAlloc use if one will be destroyed before the other.
@ -52,8 +52,8 @@ class MacroAssembler : public MacroAssemblerSpecific
}; };
AutoRooter autoRooter_; AutoRooter autoRooter_;
Maybe<IonContext> ionContext_; mozilla::Maybe<IonContext> ionContext_;
Maybe<AutoIonContextAlloc> alloc_; mozilla::Maybe<AutoIonContextAlloc> alloc_;
bool enoughMemory_; bool enoughMemory_;
private: private:

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

@ -15,6 +15,8 @@
using namespace js; using namespace js;
using namespace js::ion; using namespace js::ion;
using mozilla::DebugOnly;
static bool static bool
UseCompatibleWith(const LUse *use, LAllocation alloc) UseCompatibleWith(const LUse *use, LAllocation alloc)
{ {

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

@ -269,7 +269,7 @@ class LiveInterval
const Range *getRange(size_t i) const { const Range *getRange(size_t i) const {
return &ranges_[i]; return &ranges_[i];
} }
void setLastProcessedRange(size_t range, DebugOnly<CodePosition> pos) { void setLastProcessedRange(size_t range, mozilla::DebugOnly<CodePosition> pos) {
// If the range starts after pos, we may not be able to use // If the range starts after pos, we may not be able to use
// it in the next lastProcessedRangeIfValid call. // it in the next lastProcessedRangeIfValid call.
JS_ASSERT(ranges_[range].from <= pos); JS_ASSERT(ranges_[range].from <= pos);

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

@ -137,8 +137,8 @@ class TypedOrValueRegister
// Space to hold either an AnyRegister or a ValueOperand. // Space to hold either an AnyRegister or a ValueOperand.
union U { union U {
AlignedStorage2<AnyRegister> typed; mozilla::AlignedStorage2<AnyRegister> typed;
AlignedStorage2<ValueOperand> value; mozilla::AlignedStorage2<ValueOperand> value;
} data; } data;
AnyRegister &dataTyped() { AnyRegister &dataTyped() {
@ -197,8 +197,8 @@ class ConstantOrRegister
// Space to hold either a Value or a TypedOrValueRegister. // Space to hold either a Value or a TypedOrValueRegister.
union U { union U {
AlignedStorage2<Value> constant; mozilla::AlignedStorage2<Value> constant;
AlignedStorage2<TypedOrValueRegister> reg; mozilla::AlignedStorage2<TypedOrValueRegister> reg;
} data; } data;
Value &dataValue() { Value &dataValue() {

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

@ -14,6 +14,8 @@
#include "ion/MoveResolver.h" #include "ion/MoveResolver.h"
#include "jsopcode.h" #include "jsopcode.h"
using mozilla::DebugOnly;
namespace js { namespace js {
namespace ion { namespace ion {

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

@ -163,7 +163,7 @@ struct LabelBase
void operator =(const LabelBase &label); void operator =(const LabelBase &label);
static int id_count; static int id_count;
public: public:
DebugOnly <int> id; mozilla::DebugOnly <int> id;
static const int32 INVALID_OFFSET = -1; static const int32 INVALID_OFFSET = -1;
LabelBase() : offset_(INVALID_OFFSET), bound_(false), id(id_count++) LabelBase() : offset_(INVALID_OFFSET), bound_(false), id(id_count++)
@ -409,7 +409,7 @@ class CodeOffsetLabel
class CodeLocationJump class CodeLocationJump
{ {
uint8 *raw_; uint8 *raw_;
DebugOnly<bool> absolute_; mozilla::DebugOnly<bool> absolute_;
#ifdef JS_SMALL_BRANCH #ifdef JS_SMALL_BRANCH
uint8 *jumpTableEntry_; uint8 *jumpTableEntry_;
@ -452,7 +452,7 @@ class CodeLocationJump
class CodeLocationLabel class CodeLocationLabel
{ {
uint8 *raw_; uint8 *raw_;
DebugOnly<bool> absolute_; mozilla::DebugOnly<bool> absolute_;
public: public:
CodeLocationLabel() {} CodeLocationLabel() {}

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

@ -12,9 +12,12 @@
#include "CodeGenerator-shared-inl.h" #include "CodeGenerator-shared-inl.h"
#include "ion/IonSpewer.h" #include "ion/IonSpewer.h"
#include "ion/IonMacroAssembler.h" #include "ion/IonMacroAssembler.h"
using namespace js; using namespace js;
using namespace js::ion; using namespace js::ion;
using mozilla::DebugOnly;
namespace js { namespace js {
namespace ion { namespace ion {

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

@ -357,7 +357,7 @@ class MacroAssemblerX86Shared : public Assembler
// Builds an exit frame on the stack, with a return address to an internal // Builds an exit frame on the stack, with a return address to an internal
// non-function. Returns offset to be passed to markSafepointAt(). // non-function. Returns offset to be passed to markSafepointAt().
bool buildFakeExitFrame(const Register &scratch, uint32 *offset) { bool buildFakeExitFrame(const Register &scratch, uint32 *offset) {
DebugOnly<uint32> initialDepth = framePushed(); mozilla::DebugOnly<uint32> initialDepth = framePushed();
CodeLabel *cl = new CodeLabel(); CodeLabel *cl = new CodeLabel();
if (!addCodeLabel(cl)) if (!addCodeLabel(cl))

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

@ -16,6 +16,8 @@
using namespace js; using namespace js;
using namespace js::ion; using namespace js::ion;
using mozilla::DebugOnly;
CodeGeneratorX86::CodeGeneratorX86(MIRGenerator *gen, LIRGraph &graph) CodeGeneratorX86::CodeGeneratorX86(MIRGenerator *gen, LIRGraph &graph)
: CodeGeneratorX86Shared(gen, graph) : CodeGeneratorX86Shared(gen, graph)
{ {

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

@ -12,6 +12,8 @@
#include "jsinferinlines.h" #include "jsinferinlines.h"
#include "jsobjinlines.h" #include "jsobjinlines.h"
using mozilla::DebugOnly;
namespace js { namespace js {
namespace analyze { namespace analyze {

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

@ -15,7 +15,7 @@
#include "vm/String-inl.h" #include "vm/String-inl.h"
using namespace mozilla; using mozilla::ArrayLength;
template<size_t N> JSFlatString * template<size_t N> JSFlatString *
NewString(JSContext *cx, const jschar (&chars)[N]) NewString(JSContext *cx, const jschar (&chars)[N])

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

@ -7,7 +7,7 @@
#include "vm/String.h" #include "vm/String.h"
using namespace mozilla; using mozilla::ArrayLength;
BEGIN_TEST(testAtomizedIsNotInterned) BEGIN_TEST(testAtomizedIsNotInterned)
{ {

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

@ -94,6 +94,9 @@
using namespace js; using namespace js;
using namespace js::gc; using namespace js::gc;
using namespace js::types; using namespace js::types;
using mozilla::Maybe;
using js::frontend::Parser; using js::frontend::Parser;
bool bool

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

@ -112,11 +112,14 @@
#include "vm/ObjectImpl-inl.h" #include "vm/ObjectImpl-inl.h"
#include "vm/Stack-inl.h" #include "vm/Stack-inl.h"
using namespace mozilla;
using namespace js; using namespace js;
using namespace js::gc; using namespace js::gc;
using namespace js::types; using namespace js::types;
using mozilla::ArrayLength;
using mozilla::DebugOnly;
using mozilla::PointerRangeSize;
namespace js { namespace js {
JSBool JSBool

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

@ -36,10 +36,13 @@
#include "vm/String-inl.h" #include "vm/String-inl.h"
using namespace mozilla;
using namespace js; using namespace js;
using namespace js::gc; using namespace js::gc;
using mozilla::ArrayEnd;
using mozilla::ArrayLength;
using mozilla::RangedPtr;
const char * const char *
js_AtomToPrintableString(JSContext *cx, JSAtom *atom, JSAutoByteString *bytes) js_AtomToPrintableString(JSContext *cx, JSAtom *atom, JSAutoByteString *bytes)
{ {

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

@ -35,7 +35,7 @@ JS_STATIC_ASSERT(sizeof(HashNumber) == 4);
static JS_ALWAYS_INLINE js::HashNumber static JS_ALWAYS_INLINE js::HashNumber
HashId(jsid id) HashId(jsid id)
{ {
return HashGeneric(JSID_BITS(id)); return mozilla::HashGeneric(JSID_BITS(id));
} }
template<> template<>

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

@ -67,6 +67,8 @@
using namespace js; using namespace js;
using namespace js::gc; using namespace js::gc;
using mozilla::DebugOnly;
bool bool
js::AutoCycleDetector::init() js::AutoCycleDetector::init()
{ {

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

@ -34,7 +34,7 @@ inline bool
NewObjectCache::lookup(Class *clasp, gc::Cell *key, gc::AllocKind kind, EntryIndex *pentry) NewObjectCache::lookup(Class *clasp, gc::Cell *key, gc::AllocKind kind, EntryIndex *pentry)
{ {
uintptr_t hash = (uintptr_t(clasp) ^ uintptr_t(key)) + kind; uintptr_t hash = (uintptr_t(clasp) ^ uintptr_t(key)) + kind;
*pentry = hash % js::ArrayLength(entries); *pentry = hash % mozilla::ArrayLength(entries);
Entry *entry = &entries[*pentry]; Entry *entry = &entries[*pentry];
@ -64,7 +64,7 @@ NewObjectCache::lookupType(Class *clasp, js::types::TypeObject *type, gc::AllocK
inline void inline void
NewObjectCache::fill(EntryIndex entry_, Class *clasp, gc::Cell *key, gc::AllocKind kind, JSObject *obj) NewObjectCache::fill(EntryIndex entry_, Class *clasp, gc::Cell *key, gc::AllocKind kind, JSObject *obj)
{ {
JS_ASSERT(unsigned(entry_) < ArrayLength(entries)); JS_ASSERT(unsigned(entry_) < mozilla::ArrayLength(entries));
Entry *entry = &entries[entry_]; Entry *entry = &entries[entry_];
JS_ASSERT(!obj->hasDynamicSlots() && !obj->hasDynamicElements()); JS_ASSERT(!obj->hasDynamicSlots() && !obj->hasDynamicElements());
@ -102,7 +102,7 @@ NewObjectCache::fillType(EntryIndex entry, Class *clasp, js::types::TypeObject *
inline JSObject * inline JSObject *
NewObjectCache::newObjectFromHit(JSContext *cx, EntryIndex entry_) NewObjectCache::newObjectFromHit(JSContext *cx, EntryIndex entry_)
{ {
JS_ASSERT(unsigned(entry_) < ArrayLength(entries)); JS_ASSERT(unsigned(entry_) < mozilla::ArrayLength(entries));
Entry *entry = &entries[entry_]; Entry *entry = &entries[entry_];
JSObject *obj = js_TryNewGCObject(cx, entry->kind); JSObject *obj = js_TryNewGCObject(cx, entry->kind);

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

@ -38,10 +38,11 @@
#include "assembler/jit/ExecutableAllocator.h" #include "assembler/jit/ExecutableAllocator.h"
#endif #endif
using namespace mozilla;
using namespace js; using namespace js;
using namespace js::gc; using namespace js::gc;
using mozilla::DebugOnly;
JSCompartment::JSCompartment(JSRuntime *rt) JSCompartment::JSCompartment(JSRuntime *rt)
: rt(rt), : rt(rt),
principals(NULL), principals(NULL),

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

@ -571,11 +571,11 @@ class AutoEnterAtomsCompartment
*/ */
class ErrorCopier class ErrorCopier
{ {
Maybe<AutoCompartment> &ac; mozilla::Maybe<AutoCompartment> &ac;
RootedObject scope; RootedObject scope;
public: public:
ErrorCopier(Maybe<AutoCompartment> &ac, JSObject *scope) ErrorCopier(mozilla::Maybe<AutoCompartment> &ac, JSObject *scope)
: ac(ac), scope(ac.ref().context(), scope) {} : ac(ac), scope(ac.ref().context(), scope) {}
~ErrorCopier(); ~ErrorCopier();
}; };

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

@ -50,10 +50,11 @@
#include "vm/Stack-inl.h" #include "vm/Stack-inl.h"
using namespace mozilla;
using namespace js; using namespace js;
using namespace js::types; using namespace js::types;
using mozilla::ArrayLength;
/* /*
* The JS 'Date' object is patterned after the Java 'Date' object. * The JS 'Date' object is patterned after the Java 'Date' object.
* Here is an script: * Here is an script:

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

@ -49,7 +49,8 @@
using namespace js; using namespace js;
using namespace js::gc; using namespace js::gc;
using namespace mozilla;
using mozilla::DebugOnly;
JS_PUBLIC_API(JSBool) JS_PUBLIC_API(JSBool)
JS_GetDebugMode(JSContext *cx) JS_GetDebugMode(JSContext *cx)

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

@ -40,11 +40,12 @@
#include "vm/Stack-inl.h" #include "vm/Stack-inl.h"
#include "vm/String-inl.h" #include "vm/String-inl.h"
using namespace mozilla;
using namespace js; using namespace js;
using namespace js::gc; using namespace js::gc;
using namespace js::types; using namespace js::types;
using mozilla::ArrayLength;
/* Forward declarations for ErrorClass's initializer. */ /* Forward declarations for ErrorClass's initializer. */
static JSBool static JSBool
Exception(JSContext *cx, unsigned argc, Value *vp); Exception(JSContext *cx, unsigned argc, Value *vp);

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

@ -65,12 +65,13 @@
#include "ion/IonFrameIterator-inl.h" #include "ion/IonFrameIterator-inl.h"
#endif #endif
using namespace mozilla;
using namespace js; using namespace js;
using namespace js::gc; using namespace js::gc;
using namespace js::types; using namespace js::types;
using namespace js::frontend; using namespace js::frontend;
using mozilla::ArrayLength;
static JSBool static JSBool
fun_getProperty(JSContext *cx, HandleObject obj_, HandleId id, MutableHandleValue vp) fun_getProperty(JSContext *cx, HandleObject obj_, HandleId id, MutableHandleValue vp)
{ {

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

@ -86,7 +86,7 @@ JSFunction::initializeExtended()
{ {
JS_ASSERT(isExtended()); JS_ASSERT(isExtended());
JS_ASSERT(js::ArrayLength(toExtended()->extendedSlots) == 2); JS_ASSERT(mozilla::ArrayLength(toExtended()->extendedSlots) == 2);
toExtended()->extendedSlots[0].init(js::UndefinedValue()); toExtended()->extendedSlots[0].init(js::UndefinedValue());
toExtended()->extendedSlots[1].init(js::UndefinedValue()); toExtended()->extendedSlots[1].init(js::UndefinedValue());
} }
@ -94,14 +94,14 @@ JSFunction::initializeExtended()
inline void inline void
JSFunction::setExtendedSlot(size_t which, const js::Value &val) JSFunction::setExtendedSlot(size_t which, const js::Value &val)
{ {
JS_ASSERT(which < js::ArrayLength(toExtended()->extendedSlots)); JS_ASSERT(which < mozilla::ArrayLength(toExtended()->extendedSlots));
toExtended()->extendedSlots[which] = val; toExtended()->extendedSlots[which] = val;
} }
inline const js::Value & inline const js::Value &
JSFunction::getExtendedSlot(size_t which) const JSFunction::getExtendedSlot(size_t which) const
{ {
JS_ASSERT(which < js::ArrayLength(toExtended()->extendedSlots)); JS_ASSERT(which < mozilla::ArrayLength(toExtended()->extendedSlots));
return toExtended()->extendedSlots[which]; return toExtended()->extendedSlots[which];
} }

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

@ -108,10 +108,13 @@
#include "TraceLogging.h" #include "TraceLogging.h"
#endif #endif
using namespace mozilla;
using namespace js; using namespace js;
using namespace js::gc; using namespace js::gc;
using mozilla::ArrayEnd;
using mozilla::DebugOnly;
using mozilla::Maybe;
namespace js { namespace js {
namespace gc { namespace gc {

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

@ -1037,12 +1037,12 @@ struct GCMarker : public JSTracer {
/* The color is only applied to objects, functions and xml. */ /* The color is only applied to objects, functions and xml. */
uint32_t color; uint32_t color;
DebugOnly<bool> started; mozilla::DebugOnly<bool> started;
/* Pointer to the top of the stack of arenas we are delaying marking on. */ /* Pointer to the top of the stack of arenas we are delaying marking on. */
js::gc::ArenaHeader *unmarkedArenaStackTop; js::gc::ArenaHeader *unmarkedArenaStackTop;
/* Count of arenas that are currently in the stack. */ /* Count of arenas that are currently in the stack. */
DebugOnly<size_t> markLaterArenas; mozilla::DebugOnly<size_t> markLaterArenas;
struct GrayRoot { struct GrayRoot {
void *thing; void *thing;

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

@ -14,9 +14,11 @@
#include "jsscope.h" #include "jsscope.h"
#include "jsxml.h" #include "jsxml.h"
#include "gc/Root.h"
#include "js/TemplateLib.h" #include "js/TemplateLib.h"
using namespace JS; using JS::AssertCanGC;
namespace js { namespace js {

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

@ -54,6 +54,8 @@ using namespace js;
using namespace js::types; using namespace js::types;
using namespace js::analyze; using namespace js::analyze;
using mozilla::DebugOnly;
static inline jsid static inline jsid
id_prototype(JSContext *cx) { id_prototype(JSContext *cx) {
return NameToId(cx->names().classPrototype); return NameToId(cx->names().classPrototype);

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

@ -82,6 +82,8 @@ using namespace js;
using namespace js::gc; using namespace js::gc;
using namespace js::types; using namespace js::types;
using mozilla::DebugOnly;
/* Some objects (e.g., With) delegate 'this' to another object. */ /* Some objects (e.g., With) delegate 'this' to another object. */
static inline JSObject * static inline JSObject *
CallThisObjectHook(JSContext *cx, HandleObject obj, Value *argv) CallThisObjectHook(JSContext *cx, HandleObject obj, Value *argv)

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

@ -50,10 +50,11 @@
#include "vm/Stack-inl.h" #include "vm/Stack-inl.h"
#include "vm/String-inl.h" #include "vm/String-inl.h"
using namespace mozilla;
using namespace js; using namespace js;
using namespace js::gc; using namespace js::gc;
using mozilla::ArrayLength;
static const gc::AllocKind ITERATOR_FINALIZE_KIND = gc::FINALIZE_OBJECT2; static const gc::AllocKind ITERATOR_FINALIZE_KIND = gc::FINALIZE_OBJECT2;
void void

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

@ -58,6 +58,8 @@
using namespace js; using namespace js;
using namespace js::types; using namespace js::types;
using mozilla::RangedPtr;
/* /*
* If we're accumulating a decimal number and the number is >= 2^53, then the * If we're accumulating a decimal number and the number is >= 2^53, then the
* fast result from the loop in GetPrefixInteger may be inaccurate. Call * fast result from the loop in GetPrefixInteger may be inaccurate. Call

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

@ -68,11 +68,12 @@
#include "jsautooplen.h" #include "jsautooplen.h"
using namespace mozilla;
using namespace js; using namespace js;
using namespace js::gc; using namespace js::gc;
using namespace js::types; using namespace js::types;
using js::frontend::IsIdentifier; using js::frontend::IsIdentifier;
using mozilla::ArrayLength;
JS_STATIC_ASSERT(int32_t((JSObject::NELEMENTS_LIMIT - 1) * sizeof(Value)) == int64_t((JSObject::NELEMENTS_LIMIT - 1) * sizeof(Value))); JS_STATIC_ASSERT(int32_t((JSObject::NELEMENTS_LIMIT - 1) * sizeof(Value)) == int64_t((JSObject::NELEMENTS_LIMIT - 1) * sizeof(Value)));

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

@ -40,6 +40,8 @@ using namespace js;
using namespace js::gc; using namespace js::gc;
using namespace js::types; using namespace js::types;
using mozilla::Maybe;
Class js::JSONClass = { Class js::JSONClass = {
js_JSON_str, js_JSON_str,
JSCLASS_HAS_CACHED_PROTO(JSProto_JSON), JSCLASS_HAS_CACHED_PROTO(JSProto_JSON),

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

@ -15,6 +15,8 @@
using namespace js; using namespace js;
using mozilla::RangedPtr;
void void
JSONParser::error(const char *msg) JSONParser::error(const char *msg)
{ {

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

@ -52,12 +52,13 @@
#include "vm/RegExpObject-inl.h" #include "vm/RegExpObject-inl.h"
using namespace mozilla;
using namespace js; using namespace js;
using namespace js::gc; using namespace js::gc;
using js::frontend::IsIdentifier; using js::frontend::IsIdentifier;
using js::frontend::LetDataToGroupAssign; using js::frontend::LetDataToGroupAssign;
using js::frontend::LetDataToOffset; using js::frontend::LetDataToOffset;
using mozilla::ArrayLength;
/* /*
* Index limit must stay within 32 bits. * Index limit must stay within 32 bits.

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

@ -31,10 +31,12 @@
#include "jsscriptinlines.h" #include "jsscriptinlines.h"
using namespace mozilla;
using namespace js; using namespace js;
using namespace js::frontend; using namespace js::frontend;
using mozilla::DebugOnly;
using mozilla::ArrayLength;
namespace js { namespace js {
char const *aopNames[] = { char const *aopNames[] = {

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

@ -34,6 +34,8 @@
using namespace js; using namespace js;
using namespace js::gc; using namespace js::gc;
using mozilla::DebugOnly;
bool bool
ShapeTable::init(JSRuntime *rt, Shape *lastProp) ShapeTable::init(JSRuntime *rt, Shape *lastProp)
{ {

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

@ -894,7 +894,7 @@ class AutoRooterGetterSetter
friend void AutoGCRooter::trace(JSTracer *trc); friend void AutoGCRooter::trace(JSTracer *trc);
private: private:
Maybe<Inner> inner; mozilla::Maybe<Inner> inner;
JS_DECL_USE_GUARD_OBJECT_NOTIFIER JS_DECL_USE_GUARD_OBJECT_NOTIFIER
}; };

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

@ -159,7 +159,7 @@ BaseShape::adoptUnowned(UnownedBaseShape *other)
* unowned base shape of a new last property. * unowned base shape of a new last property.
*/ */
JS_ASSERT(isOwned()); JS_ASSERT(isOwned());
DebugOnly<uint32_t> flags = getObjectFlags(); mozilla::DebugOnly<uint32_t> flags = getObjectFlags();
JS_ASSERT((flags & other->getObjectFlags()) == flags); JS_ASSERT((flags & other->getObjectFlags()) == flags);
uint32_t span = slotSpan(); uint32_t span = slotSpan();

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

@ -40,11 +40,12 @@
#define ENABLE_TYPEDARRAY_MOVE #define ENABLE_TYPEDARRAY_MOVE
using namespace mozilla;
using namespace js; using namespace js;
using namespace js::gc; using namespace js::gc;
using namespace js::types; using namespace js::types;
using mozilla::DebugOnly;
/* /*
* Allocate array buffers with the maximum number of fixed slots marked as * Allocate array buffers with the maximum number of fixed slots marked as
* reserved, so that the fixed slots may be used for the buffer's contents. * reserved, so that the fixed slots may be used for the buffer's contents.

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

@ -12,6 +12,8 @@
using namespace js; using namespace js;
using mozilla::DebugOnly;
#ifdef JS_PARALLEL_COMPILATION #ifdef JS_PARALLEL_COMPILATION
bool bool

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

@ -54,12 +54,13 @@ size_t sE4XObjectsCreated = 0;
#include <string.h> /* for #ifdef DEBUG memset calls */ #include <string.h> /* for #ifdef DEBUG memset calls */
#endif #endif
using namespace mozilla;
using namespace js; using namespace js;
using namespace js::gc; using namespace js::gc;
using namespace js::types; using namespace js::types;
using namespace js::frontend; using namespace js::frontend;
using mozilla::ArrayLength;
template<class T, class U> template<class T, class U>
struct IdentityOp struct IdentityOp
{ {

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

@ -20,6 +20,8 @@
#include "jsscopeinlines.h" #include "jsscopeinlines.h"
#include "jstypedarrayinlines.h" #include "jstypedarrayinlines.h"
using mozilla::DebugOnly;
namespace js { namespace js {
namespace mjit { namespace mjit {

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

@ -45,6 +45,8 @@ using namespace js::mjit::ic;
#endif #endif
using namespace js::analyze; using namespace js::analyze;
using mozilla::DebugOnly;
#define RETURN_IF_OOM(retval) \ #define RETURN_IF_OOM(retval) \
JS_BEGIN_MACRO \ JS_BEGIN_MACRO \
if (oomInVector || masm.oom() || stubcc.masm.oom()) \ if (oomInVector || masm.oom() || stubcc.masm.oom()) \

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

@ -17,6 +17,8 @@ using namespace js;
using namespace js::mjit; using namespace js::mjit;
using namespace JSC; using namespace JSC;
using mozilla::DebugOnly;
typedef JSC::MacroAssembler::FPRegisterID FPRegisterID; typedef JSC::MacroAssembler::FPRegisterID FPRegisterID;
CompileStatus CompileStatus

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

@ -42,6 +42,8 @@ using namespace js;
using namespace js::mjit; using namespace js::mjit;
using namespace JSC; using namespace JSC;
using mozilla::DebugOnly;
using ic::Repatcher; using ic::Repatcher;
static jsbytecode * static jsbytecode *

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

@ -22,6 +22,8 @@
using namespace js; using namespace js;
using namespace js::mjit; using namespace js::mjit;
using mozilla::DebugOnly;
namespace js { namespace js {
namespace mjit { namespace mjit {

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

@ -55,6 +55,8 @@ using namespace js::mjit;
using namespace js::types; using namespace js::types;
using namespace JSC; using namespace JSC;
using mozilla::DebugOnly;
void JS_FASTCALL void JS_FASTCALL
stubs::BindName(VMFrame &f, PropertyName *name_) stubs::BindName(VMFrame &f, PropertyName *name_)
{ {

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

@ -77,10 +77,12 @@
#include "TraceLogging.h" #include "TraceLogging.h"
#endif #endif
using namespace mozilla;
using namespace js; using namespace js;
using namespace js::cli; using namespace js::cli;
using mozilla::ArrayLength;
using mozilla::Maybe;
typedef enum JSShellExitCode { typedef enum JSShellExitCode {
EXITCODE_RUNTIME_ERROR = 3, EXITCODE_RUNTIME_ERROR = 3,
EXITCODE_FILE_NOT_FOUND = 4, EXITCODE_FILE_NOT_FOUND = 4,
@ -2800,7 +2802,7 @@ WatchdogMain(void *arg)
int64_t sleepDuration = gWatchdogHasTimeout int64_t sleepDuration = gWatchdogHasTimeout
? gWatchdogTimeout - now ? gWatchdogTimeout - now
: PR_INTERVAL_NO_TIMEOUT; : PR_INTERVAL_NO_TIMEOUT;
DebugOnly<PRStatus> status = mozilla::DebugOnly<PRStatus> status =
PR_WaitCondVar(gWatchdogWakeup, sleepDuration); PR_WaitCondVar(gWatchdogWakeup, sleepDuration);
JS_ASSERT(status == PR_SUCCESS); JS_ASSERT(status == PR_SUCCESS);
} }

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

@ -27,7 +27,9 @@
#include "vm/Stack-inl.h" #include "vm/Stack-inl.h"
using namespace js; using namespace js;
using js::frontend::IsIdentifier; using js::frontend::IsIdentifier;
using mozilla::Maybe;
/*** Forward declarations ************************************************************************/ /*** Forward declarations ************************************************************************/

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

@ -118,7 +118,7 @@ class Debugger {
* do some things in the debugger compartment and some things in the * do some things in the debugger compartment and some things in the
* debuggee compartment. * debuggee compartment.
*/ */
JSTrapStatus handleUncaughtException(Maybe<AutoCompartment> &ac, Value *vp, bool callHook); JSTrapStatus handleUncaughtException(mozilla::Maybe<AutoCompartment> &ac, Value *vp, bool callHook);
/* /*
* Handle the result of a hook that is expected to return a resumption * Handle the result of a hook that is expected to return a resumption
@ -145,7 +145,7 @@ class Debugger {
* anything else - Make a new TypeError the pending exception and * anything else - Make a new TypeError the pending exception and
* return handleUncaughtException(ac, vp, callHook). * return handleUncaughtException(ac, vp, callHook).
*/ */
JSTrapStatus parseResumptionValue(Maybe<AutoCompartment> &ac, bool ok, const Value &rv, JSTrapStatus parseResumptionValue(mozilla::Maybe<AutoCompartment> &ac, bool ok, const Value &rv,
Value *vp, bool callHook = true); Value *vp, bool callHook = true);
GlobalObject *unwrapDebuggeeArgument(JSContext *cx, const Value &v); GlobalObject *unwrapDebuggeeArgument(JSContext *cx, const Value &v);
@ -351,7 +351,7 @@ class Debugger {
* pending exception. (This ordinarily returns true even if the ok argument * pending exception. (This ordinarily returns true even if the ok argument
* is false.) * is false.)
*/ */
bool receiveCompletionValue(Maybe<AutoCompartment> &ac, bool ok, Value val, Value *vp); bool receiveCompletionValue(mozilla::Maybe<AutoCompartment> &ac, bool ok, Value val, Value *vp);
/* /*
* Return the Debugger.Script object for |script|, or create a new one if * Return the Debugger.Script object for |script|, or create a new one if

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

@ -16,6 +16,8 @@
using namespace js; using namespace js;
using mozilla::DebugOnly;
SPSProfiler::SPSProfiler(JSRuntime *rt) SPSProfiler::SPSProfiler(JSRuntime *rt)
: rt(rt), : rt(rt),
stack_(NULL), stack_(NULL),

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

@ -261,7 +261,7 @@ class SPSProfiler
class SPSEntryMarker class SPSEntryMarker
{ {
SPSProfiler *profiler; SPSProfiler *profiler;
DebugOnly<uint32_t> size_before; mozilla::DebugOnly<uint32_t> size_before;
JS_DECL_USE_GUARD_OBJECT_NOTIFIER JS_DECL_USE_GUARD_OBJECT_NOTIFIER
public: public:
SPSEntryMarker(JSRuntime *rt JS_GUARD_OBJECT_NOTIFIER_PARAM); SPSEntryMarker(JSRuntime *rt JS_GUARD_OBJECT_NOTIFIER_PARAM);

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

@ -43,6 +43,8 @@
using namespace js; using namespace js;
using mozilla::DebugOnly;
/*****************************************************************************/ /*****************************************************************************/
void void

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

@ -14,9 +14,10 @@
#include "jsobjinlines.h" #include "jsobjinlines.h"
using namespace mozilla;
using namespace js; using namespace js;
using mozilla::RangedPtr;
bool bool
JSString::isShort() const JSString::isShort() const
{ {

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

@ -121,9 +121,9 @@ StringBuffer::appendInflated(const char *cstr, size_t cstrlen)
size_t lengthBefore = length(); size_t lengthBefore = length();
if (!cb.growByUninitialized(cstrlen)) if (!cb.growByUninitialized(cstrlen))
return false; return false;
DebugOnly<size_t> oldcstrlen = cstrlen; mozilla::DebugOnly<size_t> oldcstrlen = cstrlen;
DebugOnly<bool> ok = InflateStringToBuffer(context(), cstr, cstrlen, mozilla::DebugOnly<bool> ok = InflateStringToBuffer(context(), cstr, cstrlen,
begin() + lengthBefore, &cstrlen); begin() + lengthBefore, &cstrlen);
JS_ASSERT(ok && oldcstrlen == cstrlen); JS_ASSERT(ok && oldcstrlen == cstrlen);
return true; return true;
} }

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

@ -24,9 +24,10 @@
#include "jsobjinlines.h" #include "jsobjinlines.h"
using namespace mozilla;
using namespace js; using namespace js;
using mozilla::DebugOnly;
namespace js { namespace js {
void void