Bug 924391 - don't use JS_BITS_PER_WORD in HeapAPI.h; r=billm

This commit is contained in:
Nathan Froyd 2013-10-08 09:54:33 -04:00
parent 568f825b13
commit 021347c234

View File

@ -7,6 +7,8 @@
#ifndef js_HeapAPI_h
#define js_HeapAPI_h
#include <limits.h>
#include "jspubtd.h"
#include "js/Utility.h"
@ -134,8 +136,9 @@ GetGCThingMarkWordAndMask(const void *thing, uint32_t color,
size_t bit = (addr & js::gc::ChunkMask) / js::gc::CellSize + color;
JS_ASSERT(bit < js::gc::ChunkMarkBitmapBits);
uintptr_t *bitmap = GetGCThingMarkBitmap(thing);
*maskp = uintptr_t(1) << (bit % JS_BITS_PER_WORD);
*wordp = &bitmap[bit / JS_BITS_PER_WORD];
const uintptr_t nbits = sizeof(*bitmap) * CHAR_BIT;
*maskp = uintptr_t(1) << (bit % nbits);
*wordp = &bitmap[bit / nbits];
}
static JS_ALWAYS_INLINE JS::shadow::ArenaHeader *