зеркало из https://github.com/mozilla/gecko-dev.git
Bug 841558 - Don't exactly mark tagged NULL pointers; r=sfink
--HG-- extra : rebase_source : 062760866d171948b2f866910ebd764521ed3f6f
This commit is contained in:
Родитель
945fb871ae
Коммит
6d5075d5ea
|
@ -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 ***/
|
||||
|
||||
/*
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче