Clean up ScopedThreadStateChange to use ObjPtr
Also fixed inclusion of -inl.h files in .h files by adding
scoped_object_access-inl.h and scoped_fast_natvie_object_access-inl.h
Changed AddLocalReference / Decode to use ObjPtr.
Changed libartbenchmark to be debug to avoid linkage errors.
Bug: 31113334
Test: test-art-host
Change-Id: I4d2e160483a29d21e1e0e440585ed328b9811483
diff --git a/runtime/native/java_lang_System.cc b/runtime/native/java_lang_System.cc
index 1b399aa..8b9d0c7 100644
--- a/runtime/native/java_lang_System.cc
+++ b/runtime/native/java_lang_System.cc
@@ -24,7 +24,7 @@
#include "mirror/class-inl.h"
#include "mirror/object-inl.h"
#include "mirror/object_array-inl.h"
-#include "scoped_fast_native_object_access.h"
+#include "scoped_fast_native_object_access-inl.h"
namespace art {
@@ -60,14 +60,14 @@
}
// Make sure source and destination are both arrays.
- mirror::Object* srcObject = soa.Decode<mirror::Object*>(javaSrc);
+ ObjPtr<mirror::Object> srcObject = soa.Decode<mirror::Object>(javaSrc);
if (UNLIKELY(!srcObject->IsArrayInstance())) {
- ThrowArrayStoreException_NotAnArray("source", srcObject);
+ ThrowArrayStoreException_NotAnArray("source", srcObject.Decode());
return;
}
- mirror::Object* dstObject = soa.Decode<mirror::Object*>(javaDst);
+ ObjPtr<mirror::Object> dstObject = soa.Decode<mirror::Object>(javaDst);
if (UNLIKELY(!dstObject->IsArrayInstance())) {
- ThrowArrayStoreException_NotAnArray("destination", dstObject);
+ ThrowArrayStoreException_NotAnArray("destination", dstObject.Decode());
return;
}
mirror::Array* srcArray = srcObject->AsArray();
@@ -164,8 +164,8 @@
inline void System_arraycopyTUnchecked(JNIEnv* env, jobject javaSrc, jint srcPos,
jobject javaDst, jint dstPos, jint count) {
ScopedFastNativeObjectAccess soa(env);
- mirror::Object* srcObject = soa.Decode<mirror::Object*>(javaSrc);
- mirror::Object* dstObject = soa.Decode<mirror::Object*>(javaDst);
+ ObjPtr<mirror::Object> srcObject = soa.Decode<mirror::Object>(javaSrc);
+ ObjPtr<mirror::Object> dstObject = soa.Decode<mirror::Object>(javaDst);
DCHECK(dstObject != nullptr);
mirror::Array* srcArray = srcObject->AsArray();
mirror::Array* dstArray = dstObject->AsArray();
@@ -228,7 +228,7 @@
return 0;
}
ScopedFastNativeObjectAccess soa(env);
- mirror::Object* o = soa.Decode<mirror::Object*>(javaObject);
+ ObjPtr<mirror::Object> o = soa.Decode<mirror::Object>(javaObject);
return static_cast<jint>(o->IdentityHashCode());
}