Simplify the bitmap walker subroutines.
This change...
* Separates walking from sweeping. Walking had been implemented by a
sweeping with an empty mark bitmap argument.
* Localizes the finger machinations to scanBitmapCallback. There is
one use of the finger but all callbacks received the argument.
* Inlines a simplified bitmap walking routine operating a pointer at a
time. Only sweeping benefits from batching decoded addresses.
diff --git a/vm/alloc/CardTable.c b/vm/alloc/CardTable.c
index 4645a4d..06512ed 100644
--- a/vm/alloc/CardTable.c
+++ b/vm/alloc/CardTable.c
@@ -244,24 +244,21 @@
* table verification occurs weak references have yet to be blackened
* and so their containing objects are permitted to be gray.
*/
-static void verifyCardTableCallback(size_t numPtrs, void **ptrs,
- const void *finger, void *arg)
+static void verifyCardTableCallback(void *ptr, void *arg)
{
- size_t i;
+ Object *obj = ptr;
+ WhiteReferenceCounter ctx = { arg, 0 };
- for (i = 0; i < numPtrs; ++i) {
- Object *obj = ptrs[i];
- WhiteReferenceCounter ctx = { arg, 0 };
- dvmVisitObject(countWhiteReferenceVisitor, obj, &ctx);
- if (ctx.whiteRefs == 0) {
- continue;
- } else if (isObjectDirty(obj)) {
- continue;
- } else if (isReferentUnmarked(obj, &ctx)) {
- continue;
- } else if (isWeakInternedString(obj)) {
- continue;
- }
+ dvmVisitObject(countWhiteReferenceVisitor, obj, &ctx);
+ if (ctx.whiteRefs == 0) {
+ return;
+ } else if (isObjectDirty(obj)) {
+ return;
+ } else if (isReferentUnmarked(obj, &ctx)) {
+ return;
+ } else if (isWeakInternedString(obj)) {
+ return;
+ } else {
LOGE("Verify failed, object %p is gray", obj);
dvmDumpObject(obj);
dvmAbort();