summaryrefslogtreecommitdiffstats
path: root/runtime/interpreter/interpreter_common.h
diff options
context:
space:
mode:
authorSebastien Hertz <shertz@google.com>2013-09-17 14:10:13 +0200
committerSebastien Hertz <shertz@google.com>2013-09-17 15:28:37 +0200
commit947ff080753c786a74f1cd7aeb09f717bb7074bd (patch)
treeae8d4ceb42602b19b62b61205a5bcb70e6ef6ab3 /runtime/interpreter/interpreter_common.h
parentad5f8731448f03c59d5fc8d9b5b25ee91d351ba9 (diff)
downloadart-947ff080753c786a74f1cd7aeb09f717bb7074bd.zip
art-947ff080753c786a74f1cd7aeb09f717bb7074bd.tar.gz
art-947ff080753c786a74f1cd7aeb09f717bb7074bd.tar.bz2
Load shadow frame's this object only upon instrumentation.
We used to load the shadow frame's this object when entering the interpreter and push it into thread's SIRT to make it visible to garbage collector. But it is only used by instrumentation listeners. We now move this load at each place an instrumentation listener is called. This avoids loading it when instrumentation is disabled. This also allows to remove the SIRT reference and the push/pop management it implies when entering/exiting the interpreter. The performance improvement is 6% in average on our benchmarks suite. This CL also makes method Instrumentation::ExceptionCaughtEvent const so we can use a "const instrumentation::Instrumentation*" object in interpreter. Change-Id: I2caccba9a906f244c8057b24031250f9824cc711
Diffstat (limited to 'runtime/interpreter/interpreter_common.h')
-rw-r--r--runtime/interpreter/interpreter_common.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/runtime/interpreter/interpreter_common.h b/runtime/interpreter/interpreter_common.h
index 8cd526a..794891e 100644
--- a/runtime/interpreter/interpreter_common.h
+++ b/runtime/interpreter/interpreter_common.h
@@ -445,24 +445,24 @@ static inline int32_t DoSparseSwitch(const Instruction* inst,
static inline uint32_t FindNextInstructionFollowingException(Thread* self,
ShadowFrame& shadow_frame,
uint32_t dex_pc,
- SirtRef<Object>& this_object_ref,
- instrumentation::Instrumentation* instrumentation)
+ mirror::Object* this_object,
+ const instrumentation::Instrumentation* instrumentation)
ALWAYS_INLINE;
static inline uint32_t FindNextInstructionFollowingException(Thread* self,
ShadowFrame& shadow_frame,
uint32_t dex_pc,
- SirtRef<Object>& this_object_ref,
- instrumentation::Instrumentation* instrumentation)
+ mirror::Object* this_object,
+ const instrumentation::Instrumentation* instrumentation)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
self->VerifyStack();
ThrowLocation throw_location;
mirror::Throwable* exception = self->GetException(&throw_location);
- bool clear_exception;
+ bool clear_exception = false;
uint32_t found_dex_pc = shadow_frame.GetMethod()->FindCatchBlock(exception->GetClass(), dex_pc,
&clear_exception);
if (found_dex_pc == DexFile::kDexNoIndex) {
- instrumentation->MethodUnwindEvent(self, this_object_ref.get(),
+ instrumentation->MethodUnwindEvent(self, this_object,
shadow_frame.GetMethod(), dex_pc);
} else {
instrumentation->ExceptionCaughtEvent(self, throw_location,