Get PORTABLE + SMALL on x86.
Implemented the portable resolution trampoline and
the portable to interpreter bridge.
Also work on integrating SEA_IR in the PORTABLE+SMALL framework.
Refactor some naming and correct indenting.
Change-Id: Ibd97da5e5b6f5148274c9bff368e3654b661ef51
diff --git a/runtime/entrypoints/entrypoint_utils.cc b/runtime/entrypoints/entrypoint_utils.cc
index bf0fffa..52f8c81 100644
--- a/runtime/entrypoints/entrypoint_utils.cc
+++ b/runtime/entrypoints/entrypoint_utils.cc
@@ -23,6 +23,7 @@
#include "mirror/art_method-inl.h"
#include "mirror/class-inl.h"
#include "mirror/object-inl.h"
+#include "object_utils.h"
#include "mirror/object_array-inl.h"
#include "mirror/proxy.h"
#include "reflection.h"
diff --git a/runtime/entrypoints/entrypoint_utils.h b/runtime/entrypoints/entrypoint_utils.h
index 2b73af4..8b58cb3 100644
--- a/runtime/entrypoints/entrypoint_utils.h
+++ b/runtime/entrypoints/entrypoint_utils.h
@@ -16,7 +16,7 @@
#ifndef ART_RUNTIME_ENTRYPOINTS_ENTRYPOINT_UTILS_H_
#define ART_RUNTIME_ENTRYPOINTS_ENTRYPOINT_UTILS_H_
-
+#include "object_utils.h"
#include "class_linker.h"
#include "common_throws.h"
#include "dex_file.h"
@@ -27,7 +27,7 @@
#include "mirror/array.h"
#include "mirror/class-inl.h"
#include "mirror/throwable.h"
-#include "object_utils.h"
+
#include "thread.h"
namespace art {
diff --git a/runtime/entrypoints/portable/portable_trampoline_entrypoints.cc b/runtime/entrypoints/portable/portable_trampoline_entrypoints.cc
index e1ce11a..61f7440 100644
--- a/runtime/entrypoints/portable/portable_trampoline_entrypoints.cc
+++ b/runtime/entrypoints/portable/portable_trampoline_entrypoints.cc
@@ -42,8 +42,10 @@
#define PORTABLE_CALLEE_SAVE_FRAME__REF_AND_ARGS__FRAME_SIZE 64
#define PORTABLE_STACK_ARG_SKIP 16
#elif defined(__i386__)
-#define PORTABLE_CALLEE_SAVE_FRAME__REF_AND_ARGS__R1_OFFSET 4
-#define PORTABLE_CALLEE_SAVE_FRAME__REF_AND_ARGS__FRAME_SIZE 32
+// For x86 there are no register arguments and the stack pointer will point directly to the called
+// method argument passed by the caller.
+#define PORTABLE_CALLEE_SAVE_FRAME__REF_AND_ARGS__R1_OFFSET 0
+#define PORTABLE_CALLEE_SAVE_FRAME__REF_AND_ARGS__FRAME_SIZE 0
#define PORTABLE_STACK_ARG_SKIP 4
#else
#error "Unsupported architecture"
diff --git a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
index 392bcc5..535d540 100644
--- a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
@@ -15,8 +15,10 @@
*/
#include "callee_save_frame.h"
+#include "common_throws.h"
#include "dex_file-inl.h"
#include "dex_instruction-inl.h"
+#include "entrypoints/entrypoint_utils.h"
#include "interpreter/interpreter.h"
#include "invoke_arg_array_builder.h"
#include "mirror/art_method-inl.h"
@@ -26,6 +28,8 @@
#include "object_utils.h"
#include "runtime.h"
+
+
namespace art {
// Visits the arguments as saved to the stack by a Runtime::kRefAndArgs callee save frame.
@@ -218,10 +222,11 @@
};
// Visits arguments on the stack placing them into the shadow frame.
-class BuildShadowFrameVisitor : public QuickArgumentVisitor {
+class BuildQuickShadowFrameVisitor : public QuickArgumentVisitor {
public:
- BuildShadowFrameVisitor(mirror::ArtMethod** sp, bool is_static, const char* shorty,
- uint32_t shorty_len, ShadowFrame& sf, size_t first_arg_reg) :
+ BuildQuickShadowFrameVisitor(mirror::ArtMethod** sp,
+ bool is_static, const char* shorty,
+ uint32_t shorty_len, ShadowFrame& sf, size_t first_arg_reg) :
QuickArgumentVisitor(sp, is_static, shorty, shorty_len), sf_(sf), cur_reg_(first_arg_reg) {}
virtual void Visit() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
@@ -258,7 +263,7 @@
ShadowFrame& sf_;
size_t cur_reg_;
- DISALLOW_COPY_AND_ASSIGN(BuildShadowFrameVisitor);
+ DISALLOW_COPY_AND_ASSIGN(BuildQuickShadowFrameVisitor);
};
extern "C" uint64_t artQuickToInterpreterBridge(mirror::ArtMethod* method, Thread* self,
@@ -280,7 +285,7 @@
ShadowFrame* shadow_frame(ShadowFrame::Create(num_regs, NULL, // No last shadow coming from quick.
method, 0, memory));
size_t first_arg_reg = code_item->registers_size_ - code_item->ins_size_;
- BuildShadowFrameVisitor shadow_frame_builder(sp, mh.IsStatic(), mh.GetShorty(),
+ BuildQuickShadowFrameVisitor shadow_frame_builder(sp, mh.IsStatic(), mh.GetShorty(),
mh.GetShortyLength(),
*shadow_frame, first_arg_reg);
shadow_frame_builder.VisitArguments();