summaryrefslogtreecommitdiffstats
path: root/src/oat/runtime/support_interpreter.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/oat/runtime/support_interpreter.cc')
-rw-r--r--src/oat/runtime/support_interpreter.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/oat/runtime/support_interpreter.cc b/src/oat/runtime/support_interpreter.cc
index 3ab234fecf..6a65cea3a8 100644
--- a/src/oat/runtime/support_interpreter.cc
+++ b/src/oat/runtime/support_interpreter.cc
@@ -18,6 +18,7 @@
#include "callee_save_frame.h"
#include "dex_file-inl.h"
#include "interpreter/interpreter.h"
+#include "invoke_arg_array_builder.h"
#include "mirror/abstract_method-inl.h"
#include "mirror/class-inl.h"
#include "mirror/object-inl.h"
@@ -108,4 +109,19 @@ extern "C" uint64_t artInterpreterEntry(mirror::AbstractMethod* method, Thread*
return result.GetJ();
}
+extern "C" JValue artInterpreterToQuickEntry(Thread* self, ShadowFrame* shadow_frame)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+ mirror::AbstractMethod* method = shadow_frame->GetMethod();
+ MethodHelper mh(method);
+ const DexFile::CodeItem* code_item = mh.GetCodeItem();
+
+ uint16_t arg_offset = (code_item == NULL) ? 0 : code_item->registers_size_ - code_item->ins_size_;
+ ArgArray arg_array(mh.GetShorty(), mh.GetShortyLength());
+ arg_array.BuildArgArray(shadow_frame, arg_offset);
+ JValue result;
+ method->Invoke(self, arg_array.GetArray(), arg_array.GetNumBytes(), &result, mh.GetShorty()[0]);
+
+ return result;
+}
+
} // namespace art