diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-02-16 15:59:00 -0800 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2014-02-16 16:06:03 -0800 |
commit | d565caf5a5742e2c0b09a1edefac96c8bf354642 (patch) | |
tree | c72c8bb4f817c0247453fbf3e4ae5252e4c8c65d /runtime/entrypoints/entrypoint_utils.h | |
parent | 32a6c7f3bd76bbe574675d44b7d8076995690a5b (diff) | |
download | art-d565caf5a5742e2c0b09a1edefac96c8bf354642.zip art-d565caf5a5742e2c0b09a1edefac96c8bf354642.tar.gz art-d565caf5a5742e2c0b09a1edefac96c8bf354642.tar.bz2 |
Don't store this_object in SIRT for static invokes.
I believe this_object is sometimes is garbage for static invokes.
This may lead to bad roots being marked if ResolveMethod causes
suspension for GC.
Bug: 13051126
Change-Id: I6775b3db63ac5ce37ad423796f16c92645bd7891
Diffstat (limited to 'runtime/entrypoints/entrypoint_utils.h')
-rw-r--r-- | runtime/entrypoints/entrypoint_utils.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/entrypoints/entrypoint_utils.h b/runtime/entrypoints/entrypoint_utils.h index 20532f4..c3deba5 100644 --- a/runtime/entrypoints/entrypoint_utils.h +++ b/runtime/entrypoints/entrypoint_utils.h @@ -377,10 +377,11 @@ EXPLICIT_FIND_FIELD_FROM_CODE_TYPED_TEMPLATE_DECL(StaticPrimitiveWrite); #undef EXPLICIT_FIND_FIELD_FROM_CODE_TEMPLATE_DECL template<InvokeType type, bool access_check> -static inline mirror::ArtMethod* FindMethodFromCode(uint32_t method_idx, mirror::Object* this_object, +static inline mirror::ArtMethod* FindMethodFromCode(uint32_t method_idx, + mirror::Object* this_object, mirror::ArtMethod* referrer, Thread* self) { ClassLinker* class_linker = Runtime::Current()->GetClassLinker(); - SirtRef<mirror::Object> sirt_this(self, this_object); + SirtRef<mirror::Object> sirt_this(self, type == kStatic ? nullptr : this_object); mirror::ArtMethod* resolved_method = class_linker->ResolveMethod(method_idx, referrer, type); if (UNLIKELY(resolved_method == nullptr)) { DCHECK(self->IsExceptionPending()); // Throw exception and unwind. |