Bug 1092110: Make a few functions and members debug only; r=dougc

This commit is contained in:
Benjamin Bouvier 2014-11-04 15:30:45 +01:00
parent 09756e555d
commit 9e80e93a8f
9 changed files with 18 additions and 21 deletions

View File

@ -1977,10 +1977,10 @@ jit::AssertGraphCoherency(MIRGraph &graph)
#endif
}
#ifdef DEBUG
static void
AssertResumePointDominatedByOperands(MResumePoint *resume)
{
#ifdef DEBUG
for (size_t i = 0, e = resume->numOperands(); i < e; ++i) {
MDefinition *op = resume->getOperand(i);
if (op->type() == MIRType_MagicOptimizedArguments)
@ -1988,8 +1988,8 @@ AssertResumePointDominatedByOperands(MResumePoint *resume)
MOZ_ASSERT(op->block()->dominates(resume->block()),
"Resume point is not dominated by its operands");
}
#endif
}
#endif // DEBUG
void
jit::AssertExtendedGraphCoherency(MIRGraph &graph)

View File

@ -2209,8 +2209,7 @@ CodeGeneratorX86Shared::visitFloat32x4ToInt32x4(LFloat32x4ToInt32x4 *ins)
bool
CodeGeneratorX86Shared::visitSimdValueInt32x4(LSimdValueInt32x4 *ins)
{
MSimdValueX4 *mir = ins->mir();
MOZ_ASSERT(mir->type() == MIRType_Int32x4);
MOZ_ASSERT(ins->mir()->type() == MIRType_Int32x4);
FloatRegister output = ToFloatRegister(ins->output());
if (AssemblerX86Shared::HasSSE41()) {
@ -2235,12 +2234,10 @@ CodeGeneratorX86Shared::visitSimdValueInt32x4(LSimdValueInt32x4 *ins)
bool
CodeGeneratorX86Shared::visitSimdValueFloat32x4(LSimdValueFloat32x4 *ins)
{
MSimdValueX4 *mir = ins->mir();
MOZ_ASSERT(mir->type() == MIRType_Float32x4);
MOZ_ASSERT(ins->mir()->type() == MIRType_Float32x4);
FloatRegister output = ToFloatRegister(ins->output());
FloatRegister r0 = ToFloatRegister(ins->getOperand(0));
MOZ_ASSERT(r0 == output); // defineReuseInput(0)
MOZ_ASSERT(r0 == ToFloatRegister(ins->output())); // defineReuseInput(0)
FloatRegister r1 = ToFloatRegister(ins->getTemp(0));
FloatRegister r2 = ToFloatRegister(ins->getOperand(2));
@ -2848,9 +2845,8 @@ CodeGeneratorX86Shared::visitSimdBinaryBitwiseX4(LSimdBinaryBitwiseX4 *ins)
bool
CodeGeneratorX86Shared::visitSimdShift(LSimdShift *ins)
{
FloatRegister vec = ToFloatRegister(ins->vector());
FloatRegister out = ToFloatRegister(ins->output());
MOZ_ASSERT(vec == out); // defineReuseInput(0);
MOZ_ASSERT(ToFloatRegister(ins->vector()) == out); // defineReuseInput(0);
// TODO: If the shift count is greater than 31, this will just zero all
// lanes by default for lsh and ursh, and set the count to 32 for rsh

View File

@ -5599,6 +5599,7 @@ JS::GetWellKnownSymbol(JSContext *cx, JS::SymbolCode which)
return cx->wellKnownSymbols().get(uint32_t(which));
}
#ifdef DEBUG
static bool
PropertySpecNameIsDigits(const char *s) {
if (JS::PropertySpecNameIsSymbol(s))
@ -5611,6 +5612,7 @@ PropertySpecNameIsDigits(const char *s) {
}
return true;
}
#endif // DEBUG
JS_PUBLIC_API(bool)
JS::PropertySpecNameEqualsId(const char *name, HandleId id)

View File

@ -92,9 +92,9 @@ Bindings::initWithTemporaryStorage(ExclusiveContext *cx, InternalBindingsHandle
MOZ_ASSERT(numVars <= LOCALNO_LIMIT);
MOZ_ASSERT(numBlockScoped <= LOCALNO_LIMIT);
MOZ_ASSERT(numBodyLevelLexicals <= LOCALNO_LIMIT);
uint64_t totalSlots = uint64_t(numVars) +
uint64_t(numBodyLevelLexicals) +
uint64_t(numBlockScoped);
mozilla::DebugOnly<uint64_t> totalSlots = uint64_t(numVars) +
uint64_t(numBodyLevelLexicals) +
uint64_t(numBlockScoped);
MOZ_ASSERT(totalSlots <= LOCALNO_LIMIT);
MOZ_ASSERT(UINT32_MAX - numArgs >= totalSlots);

View File

@ -6,6 +6,8 @@
#include "vm/SelfHosting.h"
#include "mozilla/DebugOnly.h"
#include "jscntxt.h"
#include "jscompartment.h"
#include "jsdate.h"
@ -730,8 +732,7 @@ intrinsic_CloseClosingLegacyGeneratorObject(JSContext *cx, unsigned argc, Value
static bool
intrinsic_ThrowStopIteration(JSContext *cx, unsigned argc, Value *vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
MOZ_ASSERT(args.length() == 0);
MOZ_ASSERT(CallArgsFromVp(argc, vp).length() == 0);
return ThrowStopIteration(cx);
}
@ -1503,7 +1504,7 @@ CloneValue(JSContext *cx, HandleValue selfHostedValue, MutableHandleValue vp)
vp.setString(clone);
} else if (selfHostedValue.isSymbol()) {
// Well-known symbols are shared.
JS::Symbol *sym = selfHostedValue.toSymbol();
mozilla::DebugOnly<JS::Symbol *> sym = selfHostedValue.toSymbol();
MOZ_ASSERT(sym->isWellKnownSymbol());
MOZ_ASSERT(cx->wellKnownSymbols().get(size_t(sym->code())) == sym);
vp.set(selfHostedValue);

View File

@ -813,7 +813,6 @@ Activation::mostRecentProfiling()
InterpreterActivation::InterpreterActivation(RunState &state, JSContext *cx,
InterpreterFrame *entryFrame)
: Activation(cx, Interpreter),
state_(state),
entryFrame_(entryFrame),
opMask_(0)
#ifdef DEBUG
@ -822,7 +821,7 @@ InterpreterActivation::InterpreterActivation(RunState &state, JSContext *cx,
{
regs_.prepareToRun(*entryFrame, state.script());
MOZ_ASSERT(regs_.pc == state.script()->code());
MOZ_ASSERT_IF(entryFrame_->isEvalFrame(), state_.script()->isActiveEval());
MOZ_ASSERT_IF(entryFrame_->isEvalFrame(), state.script()->isActiveEval());
}
InterpreterActivation::~InterpreterActivation()

View File

@ -1161,7 +1161,6 @@ class InterpreterActivation : public Activation
{
friend class js::InterpreterFrameIterator;
RunState &state_;
InterpreterRegs regs_;
InterpreterFrame *entryFrame_;
size_t opMask_; // For debugger interrupts, see js::Interpret.

View File

@ -259,8 +259,8 @@ ThreadPool::ThreadPool(JSRuntime *rt)
: activeWorkers_(0),
joinBarrier_(nullptr),
job_(nullptr),
runtime_(rt),
#ifdef DEBUG
runtime_(rt),
stolenSlices_(0),
#endif
pendingSlices_(0),

View File

@ -178,9 +178,9 @@ class ThreadPool : public Monitor
// The current job.
ParallelJob *job_;
#ifdef DEBUG
// Initialized at startup only.
JSRuntime *const runtime_;
#ifdef DEBUG
// Number of stolen slices in the last parallel job.
mozilla::Atomic<uint32_t, mozilla::ReleaseAcquire> stolenSlices_;
#endif