From 9119c5f9e4f447f4209d51cff66d1aace510ce5e Mon Sep 17 00:00:00 2001 From: Sebastien Hertz Date: Mon, 16 Dec 2013 11:31:45 +0100 Subject: 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 --- runtime/stack.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/stack.h') 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(ref) != vregs_[i]) { + if (UNLIKELY(reinterpret_cast(ref) != vregs_[i])) { return nullptr; } return ref; -- cgit v1.1