Bug 864085 - Inline Cell::isTenured; r=billm

--HG--
extra : rebase_source : ee9d5e65652dcc6c233542c063c1e2eaf51b2bf0
This commit is contained in:
Terrence Cole 2013-05-06 11:37:07 -07:00
parent 03fcef2cfa
commit f1726d5d97
2 changed files with 12 additions and 7 deletions

View File

@ -12,6 +12,7 @@
#include <stddef.h> #include <stddef.h>
#include "jspubtd.h"
#include "jstypes.h" #include "jstypes.h"
#include "jsutil.h" #include "jsutil.h"
@ -95,7 +96,7 @@ struct Cell
#ifdef DEBUG #ifdef DEBUG
inline bool isAligned() const; inline bool isAligned() const;
bool isTenured() const; inline bool isTenured() const;
#endif #endif
protected: protected:
@ -994,6 +995,16 @@ Cell::isAligned() const
{ {
return Arena::isAligned(address(), arenaHeader()->getThingSize()); return Arena::isAligned(address(), arenaHeader()->getThingSize());
} }
bool
Cell::isTenured() const
{
#ifdef JSGC_GENERATIONAL
JS::shadow::Runtime *rt = js::gc::GetGCThingRuntime(this);
return uintptr_t(this) < rt->gcNurseryStart_ || uintptr_t(this) >= rt->gcNurseryEnd_;
#endif
return true;
}
#endif #endif
inline uintptr_t inline uintptr_t

View File

@ -261,12 +261,6 @@ ArenaHeader::checkSynchronizedWithFreeList() const
*/ */
JS_ASSERT(firstSpan.isSameNonEmptySpan(list)); JS_ASSERT(firstSpan.isSameNonEmptySpan(list));
} }
bool
js::gc::Cell::isTenured() const
{
return !IsInsideNursery(runtime(), this);
}
#endif #endif
/* static */ void /* static */ void