Remove abuse of mirror::Object* to reference special values.
Remove kInvalidIndirectRefObject, kClearedJniWeakGlobal and
ObjectRegistry::kInvalidObject. Handle error conditions by passing in or
returning an error value.
GetObjectRefType is simplified to be faster and not return invalid references
that are not expected according to the spec. Adjust check JNI and
jni_internal_test appropriately.
Fix cases in the debugger/JDWP of out arguments being passed by reference.
Bug: 17376993
Change-Id: I3ce8a28c01827e163f4dc288449959464da788b1
diff --git a/runtime/class_linker-inl.h b/runtime/class_linker-inl.h
index d05f7af..1306546 100644
--- a/runtime/class_linker-inl.h
+++ b/runtime/class_linker-inl.h
@@ -155,6 +155,11 @@
return resolved_field;
}
+inline mirror::Object* ClassLinker::AllocObject(Thread* self) {
+ return GetClassRoot(kJavaLangObject)->Alloc<false, false>(self,
+ Runtime::Current()->GetHeap()->GetCurrentAllocator());
+}
+
template <class T>
inline mirror::ObjectArray<T>* ClassLinker::AllocObjectArray(Thread* self, size_t length) {
return mirror::ObjectArray<T>::Alloc(self, GetClassRoot(kObjectArrayClass), length);