diff options
| author | 2017-07-28 12:55:17 +0100 | |
|---|---|---|
| committer | 2017-08-14 14:06:49 +0100 | |
| commit | 0888cf1821d6622fd623db31000be19b9365f81c (patch) | |
| tree | fc1e251066fa30ffd475b8a51c15f17bc976b13f /runtime/art_method-inl.h | |
| parent | f9fd236b047a4851f24a3829acfd7e3340676305 (diff) | |
ART: Use proxy ArtMethod's data_ to store the interface method.
This immensely simplifies the interface method retrieval
and removes one dependency on dex_cache_resolved_methods_.
We may later consider removing that member if we deem the
memory savings worth the performance impact.
Test: m test-art-host-gtest
Test: testrunner.py --host
Test: testrunner.py --host --jit
Change-Id: Id76349c69e4c4dea4e3b297bd504db8f98f1b7cc
Diffstat (limited to 'runtime/art_method-inl.h')
| -rw-r--r-- | runtime/art_method-inl.h | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/runtime/art_method-inl.h b/runtime/art_method-inl.h index 50e91447a9..9780522328 100644 --- a/runtime/art_method-inl.h +++ b/runtime/art_method-inl.h @@ -388,17 +388,8 @@ inline ArtMethod* ArtMethod::GetInterfaceMethodIfProxy(PointerSize pointer_size) if (LIKELY(!IsProxyMethod())) { return this; } - uint32_t method_index = GetDexMethodIndex(); - uint32_t slot_idx = method_index % mirror::DexCache::kDexCacheMethodCacheSize; - mirror::MethodDexCachePair pair = mirror::DexCache::GetNativePairPtrSize( - GetDexCacheResolvedMethods(pointer_size), slot_idx, pointer_size); - ArtMethod* interface_method = pair.GetObjectForIndex(method_index); - if (LIKELY(interface_method != nullptr)) { - DCHECK_EQ(interface_method, Runtime::Current()->GetClassLinker()->FindMethodForProxy(this)); - } else { - interface_method = Runtime::Current()->GetClassLinker()->FindMethodForProxy(this); - DCHECK(interface_method != nullptr); - } + ArtMethod* interface_method = reinterpret_cast<ArtMethod*>(GetDataPtrSize(pointer_size)); + DCHECK(interface_method->GetDeclaringClass()->IsAssignableFrom(GetDeclaringClass())); return interface_method; } |