summaryrefslogtreecommitdiff
path: root/runtime/interpreter/interpreter.cc
diff options
context:
space:
mode:
author Jeff Hao <jeffhao@google.com> 2017-05-05 16:59:29 -0700
committer Jeff Hao <jeffhao@google.com> 2017-05-16 11:28:26 -0700
commit178dce79220c16e6f0061bcd12e9e9683ec045ee (patch)
tree1cff48009b99bd67d8859f2aa13075612a1d7fee /runtime/interpreter/interpreter.cc
parent6579b099786c8cac8fdb0c86d98ad4b232a52ea0 (diff)
Stop interpreter from accessing code items of compiled code.
The ArtInterpreterToCompiledCodeBridge accesses the code item in a number of places to handle argument marshalling. However, the code item of a compiled method should have no need to be accessed by the runtime at all, since the code has been compiled. By removing these accesses, there is a drop in the memory footprint of the dex file, since these code items remain untouched by the runtime. Maps Vdex Memory Usage: 19.4/33.4MB -> 18.8/33.4MB Bug: 35800981 Test: mm test-art-host Change-Id: I147a9267ec022547b384374e1449d20bcab1ead2
Diffstat (limited to 'runtime/interpreter/interpreter.cc')
-rw-r--r--runtime/interpreter/interpreter.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/interpreter/interpreter.cc b/runtime/interpreter/interpreter.cc
index bf49e84760..f3ca3383a5 100644
--- a/runtime/interpreter/interpreter.cc
+++ b/runtime/interpreter/interpreter.cc
@@ -264,7 +264,11 @@ static inline JValue Execute(
// Pop the shadow frame before calling into compiled code.
self->PopShadowFrame();
- ArtInterpreterToCompiledCodeBridge(self, nullptr, code_item, &shadow_frame, &result);
+ // Calculate the offset of the first input reg. The input registers are in the high regs.
+ // The frame may only contain room for the inputs, in which case the arg offset is 0.
+ uint16_t arg_offset = code_item->registers_size_ == shadow_frame.NumberOfVRegs() ?
+ code_item->registers_size_ - code_item->ins_size_ : 0;
+ ArtInterpreterToCompiledCodeBridge(self, nullptr, &shadow_frame, arg_offset, &result);
// Push the shadow frame back as the caller will expect it.
self->PushShadowFrame(&shadow_frame);