summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2014-02-17 02:21:04 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2014-02-17 02:21:04 +0000
commit5a3f55ad9519e87c0d3bbddaf3d8a186a887a79b (patch)
treec72c8bb4f817c0247453fbf3e4ae5252e4c8c65d
parent32a6c7f3bd76bbe574675d44b7d8076995690a5b (diff)
parentd565caf5a5742e2c0b09a1edefac96c8bf354642 (diff)
Merge "Don't store this_object in SIRT for static invokes."
-rw-r--r--runtime/entrypoints/entrypoint_utils.h5
-rw-r--r--runtime/entrypoints/quick/quick_invoke_entrypoints.cc4
2 files changed, 5 insertions, 4 deletions
diff --git a/runtime/entrypoints/entrypoint_utils.h b/runtime/entrypoints/entrypoint_utils.h
index 20532f4399..c3deba5ae9 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.
diff --git a/runtime/entrypoints/quick/quick_invoke_entrypoints.cc b/runtime/entrypoints/quick/quick_invoke_entrypoints.cc
index c081768b73..e024a904a4 100644
--- a/runtime/entrypoints/quick/quick_invoke_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_invoke_entrypoints.cc
@@ -147,8 +147,8 @@ template<InvokeType type, bool access_check>
uint64_t artInvokeCommon(uint32_t method_idx, mirror::Object* this_object,
mirror::ArtMethod* caller_method,
Thread* self, mirror::ArtMethod** sp) {
- mirror::ArtMethod* method = FindMethodFast(method_idx, this_object, caller_method,
- access_check, type);
+ mirror::ArtMethod* method = FindMethodFast(method_idx, this_object, caller_method, access_check,
+ type);
if (UNLIKELY(method == NULL)) {
FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsAndArgs);
method = FindMethodFromCode<type, access_check>(method_idx, this_object, caller_method, self);