summaryrefslogtreecommitdiff
path: root/runtime/entrypoints/entrypoint_utils.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2015-08-03 11:56:49 +0100
committer Vladimir Marko <vmarko@google.com> 2015-09-03 17:30:57 +0100
commit05792b98980741111b4d0a24d68cff2a8e070a3a (patch)
treebad79a387bcbdaefc87c07b388099960ca9caff3 /runtime/entrypoints/entrypoint_utils.cc
parentc26b4512a01d46756683a4f5e186a0b7f397f251 (diff)
ART: Move DexCache arrays to native.
This CL has a companion CL in libcore/ https://android-review.googlesource.com/162985 Change-Id: Icbc9e20ad1b565e603195b12714762bb446515fa
Diffstat (limited to 'runtime/entrypoints/entrypoint_utils.cc')
-rw-r--r--runtime/entrypoints/entrypoint_utils.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/runtime/entrypoints/entrypoint_utils.cc b/runtime/entrypoints/entrypoint_utils.cc
index eaf33f6b7f..94aced27ed 100644
--- a/runtime/entrypoints/entrypoint_utils.cc
+++ b/runtime/entrypoints/entrypoint_utils.cc
@@ -43,9 +43,11 @@ static inline mirror::Class* CheckFilledNewArrayAlloc(uint32_t type_idx,
ThrowNegativeArraySizeException(component_count);
return nullptr; // Failure
}
- mirror::Class* klass = referrer->GetDexCacheResolvedType<false>(type_idx);
+ ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
+ size_t pointer_size = class_linker->GetImagePointerSize();
+ mirror::Class* klass = referrer->GetDexCacheResolvedType<false>(type_idx, pointer_size);
if (UNLIKELY(klass == nullptr)) { // Not in dex cache so try to resolve
- klass = Runtime::Current()->GetClassLinker()->ResolveType(type_idx, referrer);
+ klass = class_linker->ResolveType(type_idx, referrer);
if (klass == nullptr) { // Error
DCHECK(self->IsExceptionPending());
return nullptr; // Failure
@@ -214,7 +216,8 @@ void CheckReferenceResult(mirror::Object* o, Thread* self) {
return;
}
// Make sure that the result is an instance of the type this method was expected to return.
- mirror::Class* return_type = self->GetCurrentMethod(nullptr)->GetReturnType();
+ mirror::Class* return_type = self->GetCurrentMethod(nullptr)->GetReturnType(true /* resolve */,
+ sizeof(void*));
if (!o->InstanceOf(return_type)) {
Runtime::Current()->GetJavaVM()->JniAbortF(nullptr,
@@ -277,7 +280,9 @@ JValue InvokeProxyInvocationHandler(ScopedObjectAccessAlreadyRunnable& soa, cons
StackHandleScope<1> hs(soa.Self());
auto h_interface_method(hs.NewHandle(soa.Decode<mirror::Method*>(interface_method_jobj)));
// This can cause thread suspension.
- mirror::Class* result_type = h_interface_method->GetArtMethod()->GetReturnType();
+ size_t pointer_size = Runtime::Current()->GetClassLinker()->GetImagePointerSize();
+ mirror::Class* result_type =
+ h_interface_method->GetArtMethod()->GetReturnType(true /* resolve */, pointer_size);
mirror::Object* result_ref = soa.Decode<mirror::Object*>(result);
JValue result_unboxed;
if (!UnboxPrimitiveForResult(result_ref, result_type, &result_unboxed)) {