split debug_assert into ENSURE and ASSERT as discussed in a previous meeting.

the old debug_assert always ran and tested the expression, which slows
down release builds. wrapping them in #ifndef NDEBUG is clumsy. the new
ASSERT behaves like assert and ENSURE like the old debug_assert. Let's
change any time-critical but not-super-important ENSURE to ASSERT to
speed up release builds. (already done in bits.h and unique_range.h)

This was SVN commit r9362.
This commit is contained in:
janwas
2011-04-30 13:01:45 +00:00
parent 6c915291cc
commit 4663ac0fe7
225 changed files with 916 additions and 932 deletions
+4 -4
View File
@@ -51,7 +51,7 @@ jsval CScriptValRooted::get() const
jsval& CScriptValRooted::getRef() const
{
debug_assert(m_Val);
ENSURE(m_Val);
return *m_Val;
}
@@ -83,13 +83,13 @@ JSIdArray* AutoJSIdArray::get() const
size_t AutoJSIdArray::length() const
{
debug_assert(m_IdArray);
ENSURE(m_IdArray);
return m_IdArray->length;
}
jsid AutoJSIdArray::operator[](size_t i) const
{
debug_assert(m_IdArray);
debug_assert(i < (size_t)m_IdArray->length);
ENSURE(m_IdArray);
ENSURE(i < (size_t)m_IdArray->length);
return m_IdArray->vector[i];
}