Support Direct Method/Type access for X86
Thumb generates code to optimize calls to methods within core.oat.
Implement this for X86 as well, but take advantage of mov with 32 bit
immediate and call relative with 32 bit immediate.
Fix some incorrect return locations for long inlines.
Change-Id: I1907bdfc7574f3d0aa76c7fad13dc537acdf1ed3
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
diff --git a/compiler/dex/quick/gen_common.cc b/compiler/dex/quick/gen_common.cc
index c59f3b8..901d722 100644
--- a/compiler/dex/quick/gen_common.cc
+++ b/compiler/dex/quick/gen_common.cc
@@ -220,13 +220,7 @@
&is_type_initialized, &use_direct_type_ptr, &direct_type_ptr)) {
// The fast path.
if (!use_direct_type_ptr) {
- // Use the literal pool and a PC-relative load from a data word.
- LIR* data_target = ScanLiteralPool(class_literal_list_, type_idx, 0);
- if (data_target == nullptr) {
- data_target = AddWordData(&class_literal_list_, type_idx);
- }
- LIR* load_pc_rel = OpPcRelLoad(TargetReg(kArg0), data_target);
- AppendLIR(load_pc_rel);
+ LoadClassType(type_idx, kArg0);
func_offset = QUICK_ENTRYPOINT_OFFSET(pAllocArrayResolved);
CallRuntimeHelperRegMethodRegLocation(func_offset, TargetReg(kArg0), rl_src, true);
} else {
@@ -994,13 +988,7 @@
&is_type_initialized, &use_direct_type_ptr, &direct_type_ptr)) {
// The fast path.
if (!use_direct_type_ptr) {
- // Use the literal pool and a PC-relative load from a data word.
- LIR* data_target = ScanLiteralPool(class_literal_list_, type_idx, 0);
- if (data_target == nullptr) {
- data_target = AddWordData(&class_literal_list_, type_idx);
- }
- LIR* load_pc_rel = OpPcRelLoad(TargetReg(kArg0), data_target);
- AppendLIR(load_pc_rel);
+ LoadClassType(type_idx, kArg0);
if (!is_type_initialized) {
func_offset = QUICK_ENTRYPOINT_OFFSET(pAllocObjectResolved);
CallRuntimeHelperRegMethod(func_offset, TargetReg(kArg0), true);