rename mask -> maskAlignedPointer

This commit is contained in:
Joshua Warner 2013-02-10 17:14:16 -07:00
parent d26d8fdb9f
commit 2a1834e48a
4 changed files with 17 additions and 17 deletions

View File

@ -483,7 +483,7 @@ cast(void* p, unsigned offset)
template <class T>
inline T*
mask(T* p)
maskAlignedPointer(T* p)
{
return reinterpret_cast<T*>(reinterpret_cast<uintptr_t>(p) & PointerMask);
}

View File

@ -80,7 +80,7 @@ markBitAtomic(uintptr_t* map, unsigned i)
inline void*
get(void* o, unsigned offsetInWords)
{
return mask(cast<void*>(o, offsetInWords * BytesPerWord));
return maskAlignedPointer(cast<void*>(o, offsetInWords * BytesPerWord));
}
inline void**
@ -1179,12 +1179,12 @@ updateHeapMap(Context* c, void* p, void* target, unsigned offset, void* result)
void*
update(Context* c, void** p, void* target, unsigned offset, bool* needsVisit)
{
if (mask(*p) == 0) {
if (maskAlignedPointer(*p) == 0) {
*needsVisit = false;
return 0;
}
void* result = update2(c, mask(*p), needsVisit);
void* result = update2(c, maskAlignedPointer(*p), needsVisit);
if (result) {
updateHeapMap(c, p, target, offset, result);
@ -1297,20 +1297,20 @@ bitsetNext(Context* c, uintptr_t* p)
void
collect(Context* c, void** p, void* target, unsigned offset)
{
void* original = mask(*p);
void* original = maskAlignedPointer(*p);
void* parent_ = 0;
if (Debug) {
fprintf(stderr, "update %p (%s) at %p (%s)\n",
mask(*p), segment(c, *p), p, segment(c, p));
maskAlignedPointer(*p), segment(c, *p), p, segment(c, p));
}
bool needsVisit;
local::set(p, update(c, mask(p), target, offset, &needsVisit));
local::set(p, update(c, maskAlignedPointer(p), target, offset, &needsVisit));
if (Debug) {
fprintf(stderr, " result: %p (%s) (visit? %d)\n",
mask(*p), segment(c, *p), needsVisit);
maskAlignedPointer(*p), segment(c, *p), needsVisit);
}
if (not needsVisit) return;
@ -1966,10 +1966,10 @@ class MyHeap: public Heap {
bool dirty = false;
for (unsigned i = 0; i < count; ++i) {
void** target = static_cast<void**>(p) + offset + i;
if (targetNeedsMark(mask(*target))) {
if (targetNeedsMark(maskAlignedPointer(*target))) {
if (DebugFixies) {
fprintf(stderr, "dirty fixie %p at %d (%p): %p\n",
f, offset, f->body() + offset, mask(*target));
f, offset, f->body() + offset, maskAlignedPointer(*target));
}
dirty = true;
@ -1994,7 +1994,7 @@ class MyHeap: public Heap {
for (unsigned i = 0; i < count; ++i) {
void** target = static_cast<void**>(p) + offset + i;
if (targetNeedsMark(mask(*target))) {
if (targetNeedsMark(maskAlignedPointer(*target))) {
#ifdef USE_ATOMIC_OPERATIONS
map->markAtomic(target);
#else
@ -2041,7 +2041,7 @@ class MyHeap: public Heap {
}
virtual Status status(void* p) {
p = mask(p);
p = maskAlignedPointer(p);
if (p == 0) {
return Null;

View File

@ -2763,7 +2763,7 @@ class HeapClient: public Heap::Client {
virtual unsigned sizeInWords(void* p) {
Thread* t = m->rootThread;
object o = static_cast<object>(m->heap->follow(mask(p)));
object o = static_cast<object>(m->heap->follow(maskAlignedPointer(p)));
unsigned n = baseSize(t, o, static_cast<object>
(m->heap->follow(objectClass(t, o))));
@ -2778,7 +2778,7 @@ class HeapClient: public Heap::Client {
virtual unsigned copiedSizeInWords(void* p) {
Thread* t = m->rootThread;
object o = static_cast<object>(m->heap->follow(mask(p)));
object o = static_cast<object>(m->heap->follow(maskAlignedPointer(p)));
assert(t, not objectFixed(t, o));
unsigned n = baseSize(t, o, static_cast<object>
@ -2794,7 +2794,7 @@ class HeapClient: public Heap::Client {
virtual void copy(void* srcp, void* dstp) {
Thread* t = m->rootThread;
object src = static_cast<object>(m->heap->follow(mask(srcp)));
object src = static_cast<object>(m->heap->follow(maskAlignedPointer(srcp)));
assert(t, not objectFixed(t, src));
object class_ = static_cast<object>
@ -2815,7 +2815,7 @@ class HeapClient: public Heap::Client {
}
virtual void walk(void* p, Heap::Walker* w) {
object o = static_cast<object>(m->heap->follow(mask(p)));
object o = static_cast<object>(m->heap->follow(maskAlignedPointer(p)));
::walk(m->rootThread, w, o, 0);
}

View File

@ -1611,7 +1611,7 @@ typedef uint64_t (JNICALL *FastNativeFunction)(Thread*, object, uintptr_t*);
inline object
objectClass(Thread*, object o)
{
return mask(cast<object>(o, 0));
return maskAlignedPointer(cast<object>(o, 0));
}
inline unsigned