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.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.h')
| -rw-r--r-- | runtime/art_method.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/runtime/art_method.h b/runtime/art_method.h index cac40e011a..7ffd585f1a 100644 --- a/runtime/art_method.h +++ b/runtime/art_method.h @@ -458,12 +458,15 @@ class ArtMethod FINAL { SetDataPtrSize(table, pointer_size); } - ProfilingInfo* GetProfilingInfo(PointerSize pointer_size) { + ProfilingInfo* GetProfilingInfo(PointerSize pointer_size) REQUIRES_SHARED(Locks::mutator_lock_) { // Don't do a read barrier in the DCHECK, as GetProfilingInfo is called in places // where the declaring class is treated as a weak reference (accessing it with // a read barrier would either prevent unloading the class, or crash the runtime if // the GC wants to unload it). DCHECK(!IsNative<kWithoutReadBarrier>()); + if (UNLIKELY(IsProxyMethod())) { + return nullptr; + } return reinterpret_cast<ProfilingInfo*>(GetDataPtrSize(pointer_size)); } @@ -726,9 +729,13 @@ class ArtMethod FINAL { // Short cuts to declaring_class_->dex_cache_ member for fast compiled code access. mirror::MethodDexCacheType* dex_cache_resolved_methods_; - // Pointer to JNI function registered to this method, or a function to resolve the JNI function, - // or the profiling data for non-native methods, or an ImtConflictTable, or the - // single-implementation of an abstract/interface method. + // Depending on the method type, the data is + // - native method: pointer to the JNI function registered to this method + // or a function to resolve the JNI function, + // - conflict method: ImtConflictTable, + // - abstract/interface method: the single-implementation if any, + // - proxy method: the original interface method or constructor, + // - other methods: the profiling data. void* data_; // Method dispatch from quick compiled code invokes this pointer which may cause bridging into |