summaryrefslogtreecommitdiff
path: root/runtime/interpreter/interpreter.cc
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2017-05-26 21:47:30 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2017-05-26 21:47:32 +0000
commit0a5ace58e973da278049f837bf2cdbaf7b44849c (patch)
tree3ef8f5c2d148c7d4d30696cf3a618984546398b9 /runtime/interpreter/interpreter.cc
parentd8b6461dfda391284e4b6942df0e872a3da24ce9 (diff)
parent5ea8413714ceec50a758df6614dc4a3ec6179112 (diff)
Merge "Stop interpreter from accessing code items of compiled code."
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..d2f5232de1 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.
+ // It's ok to access the code item here since JIT code will have been touched by the
+ // interpreter and compiler already.
+ uint16_t arg_offset = code_item->registers_size_ - code_item->ins_size_;
+ ArtInterpreterToCompiledCodeBridge(self, nullptr, &shadow_frame, arg_offset, &result);
// Push the shadow frame back as the caller will expect it.
self->PushShadowFrame(&shadow_frame);