Add -Xcheck:jni.
I think this is as complete as possible right now. The remaining
two #if 0 sections require:
1. a way to get the Method* of the current native method.
2. a way to get the Class* of the type of a given Field*.
Change-Id: I331586022095fb36ccc10c9ac1890a59a9224d01
diff --git a/src/heap.cc b/src/heap.cc
index 42e42bd..e96714f 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -112,7 +112,7 @@
return obj;
}
-void Heap::VerifyObject(Object *obj) {
+void Heap::VerifyObject(Object* obj) {
if (!IsAligned(obj, kObjectAlignment)) {
LOG(FATAL) << "Object isn't aligned: " << obj;
} else if (!live_bitmap_->Test(obj)) {
@@ -124,6 +124,14 @@
}
}
+bool Heap::IsHeapAddress(Object* obj) {
+ if (!IsAligned(obj, kObjectAlignment)) {
+ return false;
+ }
+ // TODO
+ return true;
+}
+
void Heap::RecordAllocation(Space* space, const Object* obj) {
size_t size = space->AllocationSize(obj);
DCHECK_NE(size, 0u);