Bug 841558 - Don't exactly mark tagged NULL pointers; r=sfink

--HG--
extra : rebase_source : 062760866d171948b2f866910ebd764521ed3f6f
This commit is contained in:
Terrence Cole 2013-02-07 18:18:12 -08:00
parent aee38f2b86
commit f63afecd3e
3 changed files with 10 additions and 3 deletions

View File

@ -109,6 +109,13 @@ DeclMarker(TypeObject, types::TypeObject)
#undef DeclMarker
/* Return true if the pointer is NULL, or if it is a tagged pointer to NULL. */
JS_ALWAYS_INLINE bool
IsNullTaggedPointer(void *p)
{
return uintptr_t(p) < 32;
}
/*** Externally Typed Marking ***/
/*

View File

@ -46,7 +46,7 @@ static inline void
MarkExactStackRoot(JSTracer *trc, Rooted<void*> *rooter, ThingRootKind kind)
{
void **addr = (void **)rooter->address();
if (!*addr)
if (IsNullTaggedPointer(*addr))
return;
if (kind == THING_ROOT_OBJECT && *addr == Proxy::LazyProto)

View File

@ -359,7 +359,7 @@ js::ObjectImpl::writeBarrierPre(ObjectImpl *obj)
* This would normally be a null test, but TypeScript::global uses 0x1 as a
* special value.
*/
if (uintptr_t(obj) < 32)
if (IsNullTaggedPointer(obj))
return;
Zone *zone = obj->zone();
@ -376,7 +376,7 @@ js::ObjectImpl::writeBarrierPre(ObjectImpl *obj)
js::ObjectImpl::writeBarrierPost(ObjectImpl *obj, void *addr)
{
#ifdef JSGC_GENERATIONAL
if (uintptr_t(obj) < 32)
if (IsNullTaggedPointer(obj))
return;
obj->runtime()->gcStoreBuffer.putCell((Cell **)addr);
#endif