diff options
author | Sebastien Hertz <shertz@google.com> | 2013-12-16 11:31:45 +0100 |
---|---|---|
committer | Sebastien Hertz <shertz@google.com> | 2013-12-17 15:13:03 +0100 |
commit | 9119c5f9e4f447f4209d51cff66d1aace510ce5e (patch) | |
tree | d6f5c783b8a43a849bcc0c4cfeaffd3f1b062bcd /runtime/stack.h | |
parent | d5c0587bc26a820646950b634275ba10ab06c995 (diff) | |
download | art-9119c5f9e4f447f4209d51cff66d1aace510ce5e.zip art-9119c5f9e4f447f4209d51cff66d1aace510ce5e.tar.gz art-9119c5f9e4f447f4209d51cff66d1aace510ce5e.tar.bz2 |
Cleanup invoke's receiver handling in interpreter.
To comply with a moving collector, we used to load invoke's receiver (for non
static methods only) from the caller shadow frame after resolving the method
itself (in case the garbage collector is triggered inside) but before passing
invoke arguments, including loading receiver from the caller's shadow frame
into the callee's shadow frame. Therefore, we used to load the receiver 3 times
in the fast path but only twice in the slow path.
The slow path is rarely used (only in method requiring extra runtime checks) so
we now move this extra reload to the slow path. Therefore an invoke using the
fast path loads the receiver twice while the slow path loads it 3 times.
I don't expect much improvement here. The main reason is to keep extra code in
the slow path.
Change-Id: I10e96b10de4b8c2992e276bd564bc3e2f191779c
Diffstat (limited to 'runtime/stack.h')
-rw-r--r-- | runtime/stack.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/stack.h b/runtime/stack.h index 3d6b06a..590f406 100644 --- a/runtime/stack.h +++ b/runtime/stack.h @@ -160,7 +160,7 @@ class ShadowFrame { << ") is in protected space, reference array " << true; } // If the vreg reference is not equal to the vreg then the vreg reference is stale. - if (reinterpret_cast<uint32_t>(ref) != vregs_[i]) { + if (UNLIKELY(reinterpret_cast<uint32_t>(ref) != vregs_[i])) { return nullptr; } return ref; |