зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
49ea6392ea
Коммит
cd906e6a9c
|
@ -122,7 +122,7 @@ class HashTable : private AllocPolicy
|
|||
{
|
||||
friend class HashTable;
|
||||
HashNumber keyHash;
|
||||
DebugOnly<uint64_t> mutationCount;
|
||||
mozilla::DebugOnly<uint64_t> mutationCount;
|
||||
|
||||
AddPtr(Entry &entry, HashNumber hn) : Ptr(entry), keyHash(hn) {}
|
||||
public:
|
||||
|
@ -147,7 +147,7 @@ class HashTable : private AllocPolicy
|
|||
}
|
||||
|
||||
Entry *cur, *end;
|
||||
DebugOnly<bool> validEntry;
|
||||
mozilla::DebugOnly<bool> validEntry;
|
||||
|
||||
public:
|
||||
Range() : cur(NULL), end(NULL), validEntry(false) {}
|
||||
|
@ -268,8 +268,8 @@ class HashTable : private AllocPolicy
|
|||
#endif
|
||||
|
||||
friend class js::ReentrancyGuard;
|
||||
mutable DebugOnly<bool> entered;
|
||||
DebugOnly<uint64_t> mutationCount;
|
||||
mutable mozilla::DebugOnly<bool> entered;
|
||||
mozilla::DebugOnly<uint64_t> mutationCount;
|
||||
|
||||
/* The default initial capacity is 16, but you can ask for as small as 4. */
|
||||
static const unsigned sMinSizeLog2 = 2;
|
||||
|
|
|
@ -35,7 +35,6 @@ namespace js {
|
|||
|
||||
/* The private namespace is a superset of the public/shared namespaces. */
|
||||
using namespace JS;
|
||||
using namespace mozilla;
|
||||
|
||||
} /* namespace js */
|
||||
|
||||
|
|
|
@ -242,7 +242,7 @@ class Vector : private AllocPolicy
|
|||
size_t mReserved; /* Max elements of reserved or used space in this vector. */
|
||||
#endif
|
||||
|
||||
AlignedStorage<sInlineBytes> storage;
|
||||
mozilla::AlignedStorage<sInlineBytes> storage;
|
||||
|
||||
#ifdef DEBUG
|
||||
friend class ReentrancyGuard;
|
||||
|
@ -431,7 +431,7 @@ class Vector : private AllocPolicy
|
|||
internalAppendN(t, n);
|
||||
}
|
||||
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) {
|
||||
internalAppend(begin, length);
|
||||
|
@ -862,7 +862,7 @@ JS_ALWAYS_INLINE bool
|
|||
Vector<T,N,AP>::append(const U *insBegin, const U *insEnd)
|
||||
{
|
||||
REENTRANCY_GUARD_ET_AL;
|
||||
size_t needed = PointerRangeSize(insBegin, insEnd);
|
||||
size_t needed = mozilla::PointerRangeSize(insBegin, insEnd);
|
||||
if (mLength + needed > mCapacity && !growStorageBy(needed))
|
||||
return false;
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ public:
|
|||
|
||||
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);
|
||||
ASSERT(differenceBetween(label, result) == REPTACH_OFFSET_CALL_R11);
|
||||
return result;
|
||||
|
@ -134,7 +134,7 @@ public:
|
|||
|
||||
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));
|
||||
ASSERT(differenceBetween(label, newJump) == REPTACH_OFFSET_CALL_R11);
|
||||
return Call::fromTailJump(newJump);
|
||||
|
@ -143,7 +143,7 @@ public:
|
|||
Call makeTailRecursiveCall(Jump oldJump)
|
||||
{
|
||||
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));
|
||||
ASSERT(differenceBetween(label, newJump) == REPTACH_OFFSET_CALL_R11);
|
||||
return Call::fromTailJump(newJump);
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
|
||||
using namespace js;
|
||||
|
||||
using mozilla::AddToHash;
|
||||
using mozilla::HashString;
|
||||
|
||||
// We should be able to assert this for *any* fp->scopeChain().
|
||||
static void
|
||||
AssertInnerizedScopeChain(JSContext *cx, JSObject &scopeobj)
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
|
||||
using namespace js;
|
||||
|
||||
using mozilla::ArrayLength;
|
||||
|
||||
/* Thread-unsafe error management */
|
||||
|
||||
static char gLastError[2000];
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
using namespace js;
|
||||
using namespace js::types;
|
||||
|
||||
using mozilla::ArrayLength;
|
||||
|
||||
class RegExpMatchBuilder
|
||||
{
|
||||
JSContext * const cx;
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
using namespace js;
|
||||
using namespace JS;
|
||||
|
||||
using mozilla::ArrayLength;
|
||||
|
||||
static JSBool
|
||||
GetBuildConfiguration(JSContext *cx, unsigned argc, jsval *vp)
|
||||
{
|
||||
|
|
|
@ -64,7 +64,7 @@ class BumpChunk
|
|||
void setBump(void *ptr) {
|
||||
JS_ASSERT(bumpBase() <= ptr);
|
||||
JS_ASSERT(ptr <= limit);
|
||||
DebugOnly<char *> prevBump = bump;
|
||||
mozilla::DebugOnly<char *> prevBump = bump;
|
||||
bump = static_cast<char *>(ptr);
|
||||
#ifdef DEBUG
|
||||
JS_ASSERT(contains(prevBump));
|
||||
|
@ -225,7 +225,7 @@ class LifoAlloc
|
|||
if (latest && (result = latest->tryAlloc(n)))
|
||||
return result;
|
||||
|
||||
DebugOnly<BumpChunk *> chunk = getOrCreateChunk(n);
|
||||
mozilla::DebugOnly<BumpChunk *> chunk = getOrCreateChunk(n);
|
||||
JS_ASSERT(chunk);
|
||||
|
||||
return latest->allocInfallible(n);
|
||||
|
|
|
@ -57,6 +57,8 @@ using namespace js;
|
|||
using namespace js::gc;
|
||||
using namespace js::frontend;
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
static bool
|
||||
SetSrcNoteOffset(JSContext *cx, BytecodeEmitter *bce, unsigned index, unsigned which, ptrdiff_t offset);
|
||||
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
#include "ion/IonCode.h"
|
||||
#include "vm/String-inl.h"
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
void * const js::NullPtr::constNullValue = NULL;
|
||||
|
||||
/*
|
||||
|
|
|
@ -801,15 +801,11 @@ public:
|
|||
/*
|
||||
* AssertCanGC will assert if it is called inside of an AutoAssertNoGC region.
|
||||
*/
|
||||
#ifdef DEBUG
|
||||
JS_ALWAYS_INLINE void
|
||||
AssertCanGC()
|
||||
{
|
||||
JS_ASSERT(!InNoGCScope());
|
||||
}
|
||||
#else
|
||||
# define AssertCanGC()
|
||||
#endif
|
||||
|
||||
#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)
|
||||
extern void
|
||||
|
|
|
@ -123,7 +123,7 @@ class BailoutClosure
|
|||
BailoutFrameGuard bfg;
|
||||
};
|
||||
|
||||
Maybe<Guards> guards_;
|
||||
mozilla::Maybe<Guards> guards_;
|
||||
|
||||
StackFrame *entryfp_;
|
||||
jsbytecode *bailoutPc_;
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
using namespace js;
|
||||
using namespace js::ion;
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
namespace js {
|
||||
namespace ion {
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ class InlineForwardList : protected InlineForwardListNode<T>
|
|||
typedef InlineForwardListNode<T> Node;
|
||||
|
||||
Node *tail_;
|
||||
DebugOnly<int> modifyCount_;
|
||||
mozilla::DebugOnly<int> modifyCount_;
|
||||
|
||||
InlineForwardList<T> *thisFromConstructor() {
|
||||
return this;
|
||||
|
@ -183,7 +183,7 @@ private:
|
|||
#ifdef DEBUG
|
||||
const InlineForwardList<T> *owner_;
|
||||
#endif
|
||||
DebugOnly<int> modifyCount_;
|
||||
mozilla::DebugOnly<int> modifyCount_;
|
||||
};
|
||||
|
||||
template <typename T> class InlineList;
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
using namespace js;
|
||||
using namespace js::ion;
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
IonBuilder::IonBuilder(JSContext *cx, TempAllocator *temp, MIRGraph *graph,
|
||||
TypeOracle *oracle, CompileInfo *info, size_t inliningDepth, uint32 loopDepth)
|
||||
: MIRGenerator(cx->compartment, temp, graph, info),
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
using namespace js;
|
||||
using namespace js::ion;
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
void
|
||||
CodeLocationJump::repoint(IonCode *code, MacroAssembler *masm)
|
||||
{
|
||||
|
|
|
@ -57,7 +57,7 @@ class IonCacheName;
|
|||
|
||||
struct TypedOrValueRegisterSpace
|
||||
{
|
||||
AlignedStorage2<TypedOrValueRegister> data_;
|
||||
mozilla::AlignedStorage2<TypedOrValueRegister> data_;
|
||||
TypedOrValueRegister &data() {
|
||||
return *data_.addr();
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ struct TypedOrValueRegisterSpace
|
|||
|
||||
struct ConstantOrRegisterSpace
|
||||
{
|
||||
AlignedStorage2<ConstantOrRegister> data_;
|
||||
mozilla::AlignedStorage2<ConstantOrRegister> data_;
|
||||
ConstantOrRegister &data() {
|
||||
return *data_.addr();
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ class SafepointIndex
|
|||
uint32 safepointOffset_;
|
||||
};
|
||||
|
||||
DebugOnly<bool> resolved;
|
||||
mozilla::DebugOnly<bool> resolved;
|
||||
|
||||
public:
|
||||
SafepointIndex(uint32 displacement, LSafepoint *safepoint)
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
namespace js {
|
||||
namespace ion {
|
||||
|
||||
|
||||
// The public entrypoint for emitting assembly. Note that a MacroAssembler can
|
||||
// use cx->lifoAlloc, so take care not to interleave masm use with other
|
||||
// lifoAlloc use if one will be destroyed before the other.
|
||||
|
@ -52,8 +52,8 @@ class MacroAssembler : public MacroAssemblerSpecific
|
|||
};
|
||||
|
||||
AutoRooter autoRooter_;
|
||||
Maybe<IonContext> ionContext_;
|
||||
Maybe<AutoIonContextAlloc> alloc_;
|
||||
mozilla::Maybe<IonContext> ionContext_;
|
||||
mozilla::Maybe<AutoIonContextAlloc> alloc_;
|
||||
bool enoughMemory_;
|
||||
|
||||
private:
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
using namespace js;
|
||||
using namespace js::ion;
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
static bool
|
||||
UseCompatibleWith(const LUse *use, LAllocation alloc)
|
||||
{
|
||||
|
|
|
@ -269,7 +269,7 @@ class LiveInterval
|
|||
const Range *getRange(size_t i) const {
|
||||
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
|
||||
// it in the next lastProcessedRangeIfValid call.
|
||||
JS_ASSERT(ranges_[range].from <= pos);
|
||||
|
|
|
@ -137,8 +137,8 @@ class TypedOrValueRegister
|
|||
|
||||
// Space to hold either an AnyRegister or a ValueOperand.
|
||||
union U {
|
||||
AlignedStorage2<AnyRegister> typed;
|
||||
AlignedStorage2<ValueOperand> value;
|
||||
mozilla::AlignedStorage2<AnyRegister> typed;
|
||||
mozilla::AlignedStorage2<ValueOperand> value;
|
||||
} data;
|
||||
|
||||
AnyRegister &dataTyped() {
|
||||
|
@ -197,8 +197,8 @@ class ConstantOrRegister
|
|||
|
||||
// Space to hold either a Value or a TypedOrValueRegister.
|
||||
union U {
|
||||
AlignedStorage2<Value> constant;
|
||||
AlignedStorage2<TypedOrValueRegister> reg;
|
||||
mozilla::AlignedStorage2<Value> constant;
|
||||
mozilla::AlignedStorage2<TypedOrValueRegister> reg;
|
||||
} data;
|
||||
|
||||
Value &dataValue() {
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
#include "ion/MoveResolver.h"
|
||||
#include "jsopcode.h"
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
namespace js {
|
||||
namespace ion {
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ struct LabelBase
|
|||
void operator =(const LabelBase &label);
|
||||
static int id_count;
|
||||
public:
|
||||
DebugOnly <int> id;
|
||||
mozilla::DebugOnly <int> id;
|
||||
static const int32 INVALID_OFFSET = -1;
|
||||
|
||||
LabelBase() : offset_(INVALID_OFFSET), bound_(false), id(id_count++)
|
||||
|
@ -409,7 +409,7 @@ class CodeOffsetLabel
|
|||
class CodeLocationJump
|
||||
{
|
||||
uint8 *raw_;
|
||||
DebugOnly<bool> absolute_;
|
||||
mozilla::DebugOnly<bool> absolute_;
|
||||
|
||||
#ifdef JS_SMALL_BRANCH
|
||||
uint8 *jumpTableEntry_;
|
||||
|
@ -452,7 +452,7 @@ class CodeLocationJump
|
|||
class CodeLocationLabel
|
||||
{
|
||||
uint8 *raw_;
|
||||
DebugOnly<bool> absolute_;
|
||||
mozilla::DebugOnly<bool> absolute_;
|
||||
|
||||
public:
|
||||
CodeLocationLabel() {}
|
||||
|
|
|
@ -12,9 +12,12 @@
|
|||
#include "CodeGenerator-shared-inl.h"
|
||||
#include "ion/IonSpewer.h"
|
||||
#include "ion/IonMacroAssembler.h"
|
||||
|
||||
using namespace js;
|
||||
using namespace js::ion;
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
namespace js {
|
||||
namespace ion {
|
||||
|
||||
|
|
|
@ -357,7 +357,7 @@ class MacroAssemblerX86Shared : public Assembler
|
|||
// Builds an exit frame on the stack, with a return address to an internal
|
||||
// non-function. Returns offset to be passed to markSafepointAt().
|
||||
bool buildFakeExitFrame(const Register &scratch, uint32 *offset) {
|
||||
DebugOnly<uint32> initialDepth = framePushed();
|
||||
mozilla::DebugOnly<uint32> initialDepth = framePushed();
|
||||
|
||||
CodeLabel *cl = new CodeLabel();
|
||||
if (!addCodeLabel(cl))
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
using namespace js;
|
||||
using namespace js::ion;
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
CodeGeneratorX86::CodeGeneratorX86(MIRGenerator *gen, LIRGraph &graph)
|
||||
: CodeGeneratorX86Shared(gen, graph)
|
||||
{
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
#include "jsinferinlines.h"
|
||||
#include "jsobjinlines.h"
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
namespace js {
|
||||
namespace analyze {
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
#include "vm/String-inl.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using mozilla::ArrayLength;
|
||||
|
||||
template<size_t N> JSFlatString *
|
||||
NewString(JSContext *cx, const jschar (&chars)[N])
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include "vm/String.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using mozilla::ArrayLength;
|
||||
|
||||
BEGIN_TEST(testAtomizedIsNotInterned)
|
||||
{
|
||||
|
|
|
@ -94,6 +94,9 @@
|
|||
using namespace js;
|
||||
using namespace js::gc;
|
||||
using namespace js::types;
|
||||
|
||||
using mozilla::Maybe;
|
||||
|
||||
using js::frontend::Parser;
|
||||
|
||||
bool
|
||||
|
|
|
@ -112,11 +112,14 @@
|
|||
#include "vm/ObjectImpl-inl.h"
|
||||
#include "vm/Stack-inl.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace js;
|
||||
using namespace js::gc;
|
||||
using namespace js::types;
|
||||
|
||||
using mozilla::ArrayLength;
|
||||
using mozilla::DebugOnly;
|
||||
using mozilla::PointerRangeSize;
|
||||
|
||||
namespace js {
|
||||
|
||||
JSBool
|
||||
|
|
|
@ -36,10 +36,13 @@
|
|||
|
||||
#include "vm/String-inl.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace js;
|
||||
using namespace js::gc;
|
||||
|
||||
using mozilla::ArrayEnd;
|
||||
using mozilla::ArrayLength;
|
||||
using mozilla::RangedPtr;
|
||||
|
||||
const char *
|
||||
js_AtomToPrintableString(JSContext *cx, JSAtom *atom, JSAutoByteString *bytes)
|
||||
{
|
||||
|
|
|
@ -35,7 +35,7 @@ JS_STATIC_ASSERT(sizeof(HashNumber) == 4);
|
|||
static JS_ALWAYS_INLINE js::HashNumber
|
||||
HashId(jsid id)
|
||||
{
|
||||
return HashGeneric(JSID_BITS(id));
|
||||
return mozilla::HashGeneric(JSID_BITS(id));
|
||||
}
|
||||
|
||||
template<>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
using namespace js;
|
||||
using namespace js::gc;
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
bool
|
||||
js::AutoCycleDetector::init()
|
||||
{
|
||||
|
|
|
@ -34,7 +34,7 @@ inline bool
|
|||
NewObjectCache::lookup(Class *clasp, gc::Cell *key, gc::AllocKind kind, EntryIndex *pentry)
|
||||
{
|
||||
uintptr_t hash = (uintptr_t(clasp) ^ uintptr_t(key)) + kind;
|
||||
*pentry = hash % js::ArrayLength(entries);
|
||||
*pentry = hash % mozilla::ArrayLength(entries);
|
||||
|
||||
Entry *entry = &entries[*pentry];
|
||||
|
||||
|
@ -64,7 +64,7 @@ NewObjectCache::lookupType(Class *clasp, js::types::TypeObject *type, gc::AllocK
|
|||
inline void
|
||||
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_];
|
||||
|
||||
JS_ASSERT(!obj->hasDynamicSlots() && !obj->hasDynamicElements());
|
||||
|
@ -102,7 +102,7 @@ NewObjectCache::fillType(EntryIndex entry, Class *clasp, js::types::TypeObject *
|
|||
inline JSObject *
|
||||
NewObjectCache::newObjectFromHit(JSContext *cx, EntryIndex entry_)
|
||||
{
|
||||
JS_ASSERT(unsigned(entry_) < ArrayLength(entries));
|
||||
JS_ASSERT(unsigned(entry_) < mozilla::ArrayLength(entries));
|
||||
Entry *entry = &entries[entry_];
|
||||
|
||||
JSObject *obj = js_TryNewGCObject(cx, entry->kind);
|
||||
|
|
|
@ -38,10 +38,11 @@
|
|||
#include "assembler/jit/ExecutableAllocator.h"
|
||||
#endif
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace js;
|
||||
using namespace js::gc;
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
JSCompartment::JSCompartment(JSRuntime *rt)
|
||||
: rt(rt),
|
||||
principals(NULL),
|
||||
|
|
|
@ -571,11 +571,11 @@ class AutoEnterAtomsCompartment
|
|||
*/
|
||||
class ErrorCopier
|
||||
{
|
||||
Maybe<AutoCompartment> ∾
|
||||
mozilla::Maybe<AutoCompartment> ∾
|
||||
RootedObject scope;
|
||||
|
||||
public:
|
||||
ErrorCopier(Maybe<AutoCompartment> &ac, JSObject *scope)
|
||||
ErrorCopier(mozilla::Maybe<AutoCompartment> &ac, JSObject *scope)
|
||||
: ac(ac), scope(ac.ref().context(), scope) {}
|
||||
~ErrorCopier();
|
||||
};
|
||||
|
|
|
@ -50,10 +50,11 @@
|
|||
|
||||
#include "vm/Stack-inl.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace js;
|
||||
using namespace js::types;
|
||||
|
||||
using mozilla::ArrayLength;
|
||||
|
||||
/*
|
||||
* The JS 'Date' object is patterned after the Java 'Date' object.
|
||||
* Here is an script:
|
||||
|
|
|
@ -49,7 +49,8 @@
|
|||
|
||||
using namespace js;
|
||||
using namespace js::gc;
|
||||
using namespace mozilla;
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
JS_PUBLIC_API(JSBool)
|
||||
JS_GetDebugMode(JSContext *cx)
|
||||
|
|
|
@ -40,11 +40,12 @@
|
|||
#include "vm/Stack-inl.h"
|
||||
#include "vm/String-inl.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace js;
|
||||
using namespace js::gc;
|
||||
using namespace js::types;
|
||||
|
||||
using mozilla::ArrayLength;
|
||||
|
||||
/* Forward declarations for ErrorClass's initializer. */
|
||||
static JSBool
|
||||
Exception(JSContext *cx, unsigned argc, Value *vp);
|
||||
|
|
|
@ -65,12 +65,13 @@
|
|||
#include "ion/IonFrameIterator-inl.h"
|
||||
#endif
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace js;
|
||||
using namespace js::gc;
|
||||
using namespace js::types;
|
||||
using namespace js::frontend;
|
||||
|
||||
using mozilla::ArrayLength;
|
||||
|
||||
static JSBool
|
||||
fun_getProperty(JSContext *cx, HandleObject obj_, HandleId id, MutableHandleValue vp)
|
||||
{
|
||||
|
|
|
@ -86,7 +86,7 @@ JSFunction::initializeExtended()
|
|||
{
|
||||
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[1].init(js::UndefinedValue());
|
||||
}
|
||||
|
@ -94,14 +94,14 @@ JSFunction::initializeExtended()
|
|||
inline void
|
||||
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;
|
||||
}
|
||||
|
||||
inline const js::Value &
|
||||
JSFunction::getExtendedSlot(size_t which) const
|
||||
{
|
||||
JS_ASSERT(which < js::ArrayLength(toExtended()->extendedSlots));
|
||||
JS_ASSERT(which < mozilla::ArrayLength(toExtended()->extendedSlots));
|
||||
return toExtended()->extendedSlots[which];
|
||||
}
|
||||
|
||||
|
|
|
@ -108,10 +108,13 @@
|
|||
#include "TraceLogging.h"
|
||||
#endif
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace js;
|
||||
using namespace js::gc;
|
||||
|
||||
using mozilla::ArrayEnd;
|
||||
using mozilla::DebugOnly;
|
||||
using mozilla::Maybe;
|
||||
|
||||
namespace js {
|
||||
|
||||
namespace gc {
|
||||
|
|
|
@ -1037,12 +1037,12 @@ struct GCMarker : public JSTracer {
|
|||
/* The color is only applied to objects, functions and xml. */
|
||||
uint32_t color;
|
||||
|
||||
DebugOnly<bool> started;
|
||||
mozilla::DebugOnly<bool> started;
|
||||
|
||||
/* Pointer to the top of the stack of arenas we are delaying marking on. */
|
||||
js::gc::ArenaHeader *unmarkedArenaStackTop;
|
||||
/* Count of arenas that are currently in the stack. */
|
||||
DebugOnly<size_t> markLaterArenas;
|
||||
mozilla::DebugOnly<size_t> markLaterArenas;
|
||||
|
||||
struct GrayRoot {
|
||||
void *thing;
|
||||
|
|
|
@ -14,9 +14,11 @@
|
|||
#include "jsscope.h"
|
||||
#include "jsxml.h"
|
||||
|
||||
#include "gc/Root.h"
|
||||
|
||||
#include "js/TemplateLib.h"
|
||||
|
||||
using namespace JS;
|
||||
using JS::AssertCanGC;
|
||||
|
||||
namespace js {
|
||||
|
||||
|
|
|
@ -54,6 +54,8 @@ using namespace js;
|
|||
using namespace js::types;
|
||||
using namespace js::analyze;
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
static inline jsid
|
||||
id_prototype(JSContext *cx) {
|
||||
return NameToId(cx->names().classPrototype);
|
||||
|
|
|
@ -82,6 +82,8 @@ using namespace js;
|
|||
using namespace js::gc;
|
||||
using namespace js::types;
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
/* Some objects (e.g., With) delegate 'this' to another object. */
|
||||
static inline JSObject *
|
||||
CallThisObjectHook(JSContext *cx, HandleObject obj, Value *argv)
|
||||
|
|
|
@ -50,10 +50,11 @@
|
|||
#include "vm/Stack-inl.h"
|
||||
#include "vm/String-inl.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace js;
|
||||
using namespace js::gc;
|
||||
|
||||
using mozilla::ArrayLength;
|
||||
|
||||
static const gc::AllocKind ITERATOR_FINALIZE_KIND = gc::FINALIZE_OBJECT2;
|
||||
|
||||
void
|
||||
|
|
|
@ -58,6 +58,8 @@
|
|||
using namespace js;
|
||||
using namespace js::types;
|
||||
|
||||
using mozilla::RangedPtr;
|
||||
|
||||
/*
|
||||
* 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
|
||||
|
|
|
@ -68,11 +68,12 @@
|
|||
|
||||
#include "jsautooplen.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace js;
|
||||
using namespace js::gc;
|
||||
using namespace js::types;
|
||||
|
||||
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)));
|
||||
|
||||
|
|
|
@ -40,6 +40,8 @@ using namespace js;
|
|||
using namespace js::gc;
|
||||
using namespace js::types;
|
||||
|
||||
using mozilla::Maybe;
|
||||
|
||||
Class js::JSONClass = {
|
||||
js_JSON_str,
|
||||
JSCLASS_HAS_CACHED_PROTO(JSProto_JSON),
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
|
||||
using namespace js;
|
||||
|
||||
using mozilla::RangedPtr;
|
||||
|
||||
void
|
||||
JSONParser::error(const char *msg)
|
||||
{
|
||||
|
|
|
@ -52,12 +52,13 @@
|
|||
|
||||
#include "vm/RegExpObject-inl.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace js;
|
||||
using namespace js::gc;
|
||||
|
||||
using js::frontend::IsIdentifier;
|
||||
using js::frontend::LetDataToGroupAssign;
|
||||
using js::frontend::LetDataToOffset;
|
||||
using mozilla::ArrayLength;
|
||||
|
||||
/*
|
||||
* Index limit must stay within 32 bits.
|
||||
|
|
|
@ -31,10 +31,12 @@
|
|||
|
||||
#include "jsscriptinlines.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace js;
|
||||
using namespace js::frontend;
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
using mozilla::ArrayLength;
|
||||
|
||||
namespace js {
|
||||
|
||||
char const *aopNames[] = {
|
||||
|
|
|
@ -34,6 +34,8 @@
|
|||
using namespace js;
|
||||
using namespace js::gc;
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
bool
|
||||
ShapeTable::init(JSRuntime *rt, Shape *lastProp)
|
||||
{
|
||||
|
|
|
@ -894,7 +894,7 @@ class AutoRooterGetterSetter
|
|||
friend void AutoGCRooter::trace(JSTracer *trc);
|
||||
|
||||
private:
|
||||
Maybe<Inner> inner;
|
||||
mozilla::Maybe<Inner> inner;
|
||||
JS_DECL_USE_GUARD_OBJECT_NOTIFIER
|
||||
};
|
||||
|
||||
|
|
|
@ -159,7 +159,7 @@ BaseShape::adoptUnowned(UnownedBaseShape *other)
|
|||
* unowned base shape of a new last property.
|
||||
*/
|
||||
JS_ASSERT(isOwned());
|
||||
DebugOnly<uint32_t> flags = getObjectFlags();
|
||||
mozilla::DebugOnly<uint32_t> flags = getObjectFlags();
|
||||
JS_ASSERT((flags & other->getObjectFlags()) == flags);
|
||||
|
||||
uint32_t span = slotSpan();
|
||||
|
|
|
@ -40,11 +40,12 @@
|
|||
|
||||
#define ENABLE_TYPEDARRAY_MOVE
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace js;
|
||||
using namespace js::gc;
|
||||
using namespace js::types;
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
/*
|
||||
* 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.
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
|
||||
using namespace js;
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
#ifdef JS_PARALLEL_COMPILATION
|
||||
|
||||
bool
|
||||
|
|
|
@ -54,12 +54,13 @@ size_t sE4XObjectsCreated = 0;
|
|||
#include <string.h> /* for #ifdef DEBUG memset calls */
|
||||
#endif
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace js;
|
||||
using namespace js::gc;
|
||||
using namespace js::types;
|
||||
using namespace js::frontend;
|
||||
|
||||
using mozilla::ArrayLength;
|
||||
|
||||
template<class T, class U>
|
||||
struct IdentityOp
|
||||
{
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
#include "jsscopeinlines.h"
|
||||
#include "jstypedarrayinlines.h"
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
namespace js {
|
||||
namespace mjit {
|
||||
|
||||
|
|
|
@ -45,6 +45,8 @@ using namespace js::mjit::ic;
|
|||
#endif
|
||||
using namespace js::analyze;
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
#define RETURN_IF_OOM(retval) \
|
||||
JS_BEGIN_MACRO \
|
||||
if (oomInVector || masm.oom() || stubcc.masm.oom()) \
|
||||
|
|
|
@ -17,6 +17,8 @@ using namespace js;
|
|||
using namespace js::mjit;
|
||||
using namespace JSC;
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
typedef JSC::MacroAssembler::FPRegisterID FPRegisterID;
|
||||
|
||||
CompileStatus
|
||||
|
|
|
@ -42,6 +42,8 @@ using namespace js;
|
|||
using namespace js::mjit;
|
||||
using namespace JSC;
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
using ic::Repatcher;
|
||||
|
||||
static jsbytecode *
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
using namespace js;
|
||||
using namespace js::mjit;
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
namespace js {
|
||||
namespace mjit {
|
||||
|
||||
|
|
|
@ -55,6 +55,8 @@ using namespace js::mjit;
|
|||
using namespace js::types;
|
||||
using namespace JSC;
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
void JS_FASTCALL
|
||||
stubs::BindName(VMFrame &f, PropertyName *name_)
|
||||
{
|
||||
|
|
|
@ -77,10 +77,12 @@
|
|||
#include "TraceLogging.h"
|
||||
#endif
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace js;
|
||||
using namespace js::cli;
|
||||
|
||||
using mozilla::ArrayLength;
|
||||
using mozilla::Maybe;
|
||||
|
||||
typedef enum JSShellExitCode {
|
||||
EXITCODE_RUNTIME_ERROR = 3,
|
||||
EXITCODE_FILE_NOT_FOUND = 4,
|
||||
|
@ -2800,7 +2802,7 @@ WatchdogMain(void *arg)
|
|||
int64_t sleepDuration = gWatchdogHasTimeout
|
||||
? gWatchdogTimeout - now
|
||||
: PR_INTERVAL_NO_TIMEOUT;
|
||||
DebugOnly<PRStatus> status =
|
||||
mozilla::DebugOnly<PRStatus> status =
|
||||
PR_WaitCondVar(gWatchdogWakeup, sleepDuration);
|
||||
JS_ASSERT(status == PR_SUCCESS);
|
||||
}
|
||||
|
|
|
@ -27,7 +27,9 @@
|
|||
#include "vm/Stack-inl.h"
|
||||
|
||||
using namespace js;
|
||||
|
||||
using js::frontend::IsIdentifier;
|
||||
using mozilla::Maybe;
|
||||
|
||||
|
||||
/*** Forward declarations ************************************************************************/
|
||||
|
|
|
@ -118,7 +118,7 @@ class Debugger {
|
|||
* do some things in the debugger compartment and some things in the
|
||||
* 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
|
||||
|
@ -145,7 +145,7 @@ class Debugger {
|
|||
* anything else - Make a new TypeError the pending exception and
|
||||
* 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);
|
||||
|
||||
GlobalObject *unwrapDebuggeeArgument(JSContext *cx, const Value &v);
|
||||
|
@ -351,7 +351,7 @@ class Debugger {
|
|||
* pending exception. (This ordinarily returns true even if the ok argument
|
||||
* 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
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
|
||||
using namespace js;
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
SPSProfiler::SPSProfiler(JSRuntime *rt)
|
||||
: rt(rt),
|
||||
stack_(NULL),
|
||||
|
|
|
@ -261,7 +261,7 @@ class SPSProfiler
|
|||
class SPSEntryMarker
|
||||
{
|
||||
SPSProfiler *profiler;
|
||||
DebugOnly<uint32_t> size_before;
|
||||
mozilla::DebugOnly<uint32_t> size_before;
|
||||
JS_DECL_USE_GUARD_OBJECT_NOTIFIER
|
||||
public:
|
||||
SPSEntryMarker(JSRuntime *rt JS_GUARD_OBJECT_NOTIFIER_PARAM);
|
||||
|
|
|
@ -43,6 +43,8 @@
|
|||
|
||||
using namespace js;
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
void
|
||||
|
|
|
@ -14,9 +14,10 @@
|
|||
|
||||
#include "jsobjinlines.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace js;
|
||||
|
||||
using mozilla::RangedPtr;
|
||||
|
||||
bool
|
||||
JSString::isShort() const
|
||||
{
|
||||
|
|
|
@ -121,9 +121,9 @@ StringBuffer::appendInflated(const char *cstr, size_t cstrlen)
|
|||
size_t lengthBefore = length();
|
||||
if (!cb.growByUninitialized(cstrlen))
|
||||
return false;
|
||||
DebugOnly<size_t> oldcstrlen = cstrlen;
|
||||
DebugOnly<bool> ok = InflateStringToBuffer(context(), cstr, cstrlen,
|
||||
begin() + lengthBefore, &cstrlen);
|
||||
mozilla::DebugOnly<size_t> oldcstrlen = cstrlen;
|
||||
mozilla::DebugOnly<bool> ok = InflateStringToBuffer(context(), cstr, cstrlen,
|
||||
begin() + lengthBefore, &cstrlen);
|
||||
JS_ASSERT(ok && oldcstrlen == cstrlen);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -24,9 +24,10 @@
|
|||
|
||||
#include "jsobjinlines.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace js;
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
namespace js {
|
||||
|
||||
void
|
||||
|
|
Загрузка…
Ссылка в новой задаче