From 0b40ecf156e309aa17c72a28cd1b0237dbfb8746 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Fri, 20 Mar 2015 12:08:03 +0000 Subject: [PATCH] Quick: Clean up slow paths. Change-Id: I278d42be77b02778c4a419ae9024b37929915b64 --- compiler/dex/quick/arm/call_arm.cc | 2 +- compiler/dex/quick/arm64/call_arm64.cc | 4 ++-- compiler/dex/quick/gen_common.cc | 36 ++++++++++++++++---------------- compiler/dex/quick/gen_invoke.cc | 3 ++- compiler/dex/quick/mips/call_mips.cc | 2 +- compiler/dex/quick/mips64/call_mips64.cc | 2 +- compiler/dex/quick/mir_to_lir.cc | 2 +- compiler/dex/quick/mir_to_lir.h | 6 +++--- compiler/dex/quick/x86/call_x86.cc | 2 +- compiler/dex/quick/x86/int_x86.cc | 4 ++-- 10 files changed, 32 insertions(+), 31 deletions(-) diff --git a/compiler/dex/quick/arm/call_arm.cc b/compiler/dex/quick/arm/call_arm.cc index 1a9dbeae0..318292029 100644 --- a/compiler/dex/quick/arm/call_arm.cc +++ b/compiler/dex/quick/arm/call_arm.cc @@ -433,7 +433,7 @@ void ArmMir2Lir::GenEntrySequence(RegLocation* ArgLocs, RegLocation rl_method) { class StackOverflowSlowPath : public LIRSlowPath { public: StackOverflowSlowPath(Mir2Lir* m2l, LIR* branch, bool restore_lr, size_t sp_displace) - : LIRSlowPath(m2l, m2l->GetCurrentDexPc(), branch, nullptr), restore_lr_(restore_lr), + : LIRSlowPath(m2l, branch), restore_lr_(restore_lr), sp_displace_(sp_displace) { } void Compile() OVERRIDE { diff --git a/compiler/dex/quick/arm64/call_arm64.cc b/compiler/dex/quick/arm64/call_arm64.cc index 82751626e..1dcbe609b 100644 --- a/compiler/dex/quick/arm64/call_arm64.cc +++ b/compiler/dex/quick/arm64/call_arm64.cc @@ -351,8 +351,8 @@ void Arm64Mir2Lir::GenEntrySequence(RegLocation* ArgLocs, RegLocation rl_method) if (generate_explicit_stack_overflow_check) { class StackOverflowSlowPath: public LIRSlowPath { public: - StackOverflowSlowPath(Mir2Lir* m2l, LIR* branch, size_t sp_displace) : - LIRSlowPath(m2l, m2l->GetCurrentDexPc(), branch, nullptr), + StackOverflowSlowPath(Mir2Lir* m2l, LIR* branch, size_t sp_displace) + : LIRSlowPath(m2l, branch), sp_displace_(sp_displace) { } void Compile() OVERRIDE { diff --git a/compiler/dex/quick/gen_common.cc b/compiler/dex/quick/gen_common.cc index 32a469db8..d613ccab6 100644 --- a/compiler/dex/quick/gen_common.cc +++ b/compiler/dex/quick/gen_common.cc @@ -86,7 +86,7 @@ void Mir2Lir::AddDivZeroCheckSlowPath(LIR* branch) { class DivZeroCheckSlowPath : public Mir2Lir::LIRSlowPath { public: DivZeroCheckSlowPath(Mir2Lir* m2l, LIR* branch_in) - : LIRSlowPath(m2l, m2l->GetCurrentDexPc(), branch_in) { + : LIRSlowPath(m2l, branch_in) { } void Compile() OVERRIDE { @@ -105,7 +105,7 @@ void Mir2Lir::GenArrayBoundsCheck(RegStorage index, RegStorage length) { public: ArrayBoundsCheckSlowPath(Mir2Lir* m2l, LIR* branch_in, RegStorage index_in, RegStorage length_in) - : LIRSlowPath(m2l, m2l->GetCurrentDexPc(), branch_in), + : LIRSlowPath(m2l, branch_in), index_(index_in), length_(length_in) { } @@ -129,7 +129,7 @@ void Mir2Lir::GenArrayBoundsCheck(int index, RegStorage length) { class ArrayBoundsCheckSlowPath : public Mir2Lir::LIRSlowPath { public: ArrayBoundsCheckSlowPath(Mir2Lir* m2l, LIR* branch_in, int index_in, RegStorage length_in) - : LIRSlowPath(m2l, m2l->GetCurrentDexPc(), branch_in), + : LIRSlowPath(m2l, branch_in), index_(index_in), length_(length_in) { } @@ -159,7 +159,7 @@ LIR* Mir2Lir::GenNullCheck(RegStorage reg) { class NullCheckSlowPath : public Mir2Lir::LIRSlowPath { public: NullCheckSlowPath(Mir2Lir* m2l, LIR* branch) - : LIRSlowPath(m2l, m2l->GetCurrentDexPc(), branch) { + : LIRSlowPath(m2l, branch) { } void Compile() OVERRIDE { @@ -581,7 +581,7 @@ class StaticFieldSlowPath : public Mir2Lir::LIRSlowPath { // At least one will be non-null here, otherwise we wouldn't generate the slow path. StaticFieldSlowPath(Mir2Lir* m2l, LIR* unresolved, LIR* uninit, LIR* cont, int storage_index, RegStorage r_base) - : LIRSlowPath(m2l, m2l->GetCurrentDexPc(), unresolved != nullptr ? unresolved : uninit, cont), + : LIRSlowPath(m2l, unresolved != nullptr ? unresolved : uninit, cont), second_branch_(unresolved != nullptr ? uninit : nullptr), storage_index_(storage_index), r_base_(r_base) { } @@ -1052,9 +1052,9 @@ void Mir2Lir::GenConstClass(uint32_t type_idx, RegLocation rl_dest) { class SlowPath : public LIRSlowPath { public: SlowPath(Mir2Lir* m2l, LIR* fromfast, LIR* cont_in, const int type_idx_in, - const RegLocation& rl_method_in, const RegLocation& rl_result_in) : - LIRSlowPath(m2l, m2l->GetCurrentDexPc(), fromfast, cont_in), - type_idx_(type_idx_in), rl_method_(rl_method_in), rl_result_(rl_result_in) { + const RegLocation& rl_method_in, const RegLocation& rl_result_in) + : LIRSlowPath(m2l, fromfast, cont_in), + type_idx_(type_idx_in), rl_method_(rl_method_in), rl_result_(rl_result_in) { } void Compile() { @@ -1120,9 +1120,9 @@ void Mir2Lir::GenConstString(uint32_t string_idx, RegLocation rl_dest) { class SlowPath : public LIRSlowPath { public: SlowPath(Mir2Lir* m2l, LIR* fromfast_in, LIR* cont_in, RegStorage r_method_in, - int32_t string_idx_in) : - LIRSlowPath(m2l, m2l->GetCurrentDexPc(), fromfast_in, cont_in), - r_method_(r_method_in), string_idx_(string_idx_in) { + int32_t string_idx_in) + : LIRSlowPath(m2l, fromfast_in, cont_in), + r_method_(r_method_in), string_idx_(string_idx_in) { } void Compile() { @@ -1304,7 +1304,7 @@ void Mir2Lir::GenInstanceofCallingHelper(bool needs_access_check, bool type_know public: InitTypeSlowPath(Mir2Lir* m2l, LIR* branch, LIR* cont, uint32_t type_idx_in, RegLocation rl_src_in) - : LIRSlowPath(m2l, m2l->GetCurrentDexPc(), branch, cont), type_idx_(type_idx_in), + : LIRSlowPath(m2l, branch, cont), type_idx_(type_idx_in), rl_src_(rl_src_in) { } @@ -1453,9 +1453,9 @@ void Mir2Lir::GenCheckCast(int opt_flags, uint32_t insn_idx, uint32_t type_idx, class SlowPath : public LIRSlowPath { public: SlowPath(Mir2Lir* m2l, LIR* fromfast, LIR* cont_in, const int type_idx_in, - const RegStorage class_reg_in) : - LIRSlowPath(m2l, m2l->GetCurrentDexPc(), fromfast, cont_in), - type_idx_(type_idx_in), class_reg_(class_reg_in) { + const RegStorage class_reg_in) + : LIRSlowPath(m2l, fromfast, cont_in), + type_idx_(type_idx_in), class_reg_(class_reg_in) { } void Compile() { @@ -1484,8 +1484,8 @@ void Mir2Lir::GenCheckCast(int opt_flags, uint32_t insn_idx, uint32_t type_idx, // to call a helper function to do the check. class SlowPath : public LIRSlowPath { public: - SlowPath(Mir2Lir* m2l, LIR* fromfast, LIR* cont, bool load): - LIRSlowPath(m2l, m2l->GetCurrentDexPc(), fromfast, cont), load_(load) { + SlowPath(Mir2Lir* m2l, LIR* fromfast, LIR* cont, bool load) + : LIRSlowPath(m2l, fromfast, cont), load_(load) { } void Compile() { @@ -2179,7 +2179,7 @@ void Mir2Lir::GenConversionCall(QuickEntrypointEnum trampoline, RegLocation rl_d class Mir2Lir::SuspendCheckSlowPath : public Mir2Lir::LIRSlowPath { public: SuspendCheckSlowPath(Mir2Lir* m2l, LIR* branch, LIR* cont) - : LIRSlowPath(m2l, m2l->GetCurrentDexPc(), branch, cont) { + : LIRSlowPath(m2l, branch, cont) { } void Compile() OVERRIDE { diff --git a/compiler/dex/quick/gen_invoke.cc b/compiler/dex/quick/gen_invoke.cc index 6b553fd18..2d41ba179 100755 --- a/compiler/dex/quick/gen_invoke.cc +++ b/compiler/dex/quick/gen_invoke.cc @@ -48,7 +48,8 @@ void Mir2Lir::AddIntrinsicSlowPath(CallInfo* info, LIR* branch, LIR* resume) { class IntrinsicSlowPathPath : public Mir2Lir::LIRSlowPath { public: IntrinsicSlowPathPath(Mir2Lir* m2l, CallInfo* info_in, LIR* branch_in, LIR* resume_in) - : LIRSlowPath(m2l, info_in->offset, branch_in, resume_in), info_(info_in) { + : LIRSlowPath(m2l, branch_in, resume_in), info_(info_in) { + DCHECK_EQ(info_in->offset, current_dex_pc_); } void Compile() { diff --git a/compiler/dex/quick/mips/call_mips.cc b/compiler/dex/quick/mips/call_mips.cc index d9471f6fd..b067221c2 100644 --- a/compiler/dex/quick/mips/call_mips.cc +++ b/compiler/dex/quick/mips/call_mips.cc @@ -263,7 +263,7 @@ void MipsMir2Lir::GenEntrySequence(RegLocation* ArgLocs, RegLocation rl_method) class StackOverflowSlowPath : public LIRSlowPath { public: StackOverflowSlowPath(Mir2Lir* m2l, LIR* branch, size_t sp_displace) - : LIRSlowPath(m2l, m2l->GetCurrentDexPc(), branch, nullptr), sp_displace_(sp_displace) { + : LIRSlowPath(m2l, branch), sp_displace_(sp_displace) { } void Compile() OVERRIDE { m2l_->ResetRegPool(); diff --git a/compiler/dex/quick/mips64/call_mips64.cc b/compiler/dex/quick/mips64/call_mips64.cc index 31be1c21a..0e587706c 100644 --- a/compiler/dex/quick/mips64/call_mips64.cc +++ b/compiler/dex/quick/mips64/call_mips64.cc @@ -268,7 +268,7 @@ void Mips64Mir2Lir::GenEntrySequence(RegLocation* ArgLocs, RegLocation rl_method class StackOverflowSlowPath : public LIRSlowPath { public: StackOverflowSlowPath(Mir2Lir* m2l, LIR* branch, size_t sp_displace) - : LIRSlowPath(m2l, m2l->GetCurrentDexPc(), branch, nullptr), sp_displace_(sp_displace) { + : LIRSlowPath(m2l, branch), sp_displace_(sp_displace) { } void Compile() OVERRIDE { m2l_->ResetRegPool(); diff --git a/compiler/dex/quick/mir_to_lir.cc b/compiler/dex/quick/mir_to_lir.cc index 8fc45dc30..afacee02d 100644 --- a/compiler/dex/quick/mir_to_lir.cc +++ b/compiler/dex/quick/mir_to_lir.cc @@ -27,7 +27,7 @@ namespace art { class Mir2Lir::SpecialSuspendCheckSlowPath : public Mir2Lir::LIRSlowPath { public: SpecialSuspendCheckSlowPath(Mir2Lir* m2l, LIR* branch, LIR* cont) - : LIRSlowPath(m2l, m2l->GetCurrentDexPc(), branch, cont), + : LIRSlowPath(m2l, branch, cont), num_used_args_(0u) { } diff --git a/compiler/dex/quick/mir_to_lir.h b/compiler/dex/quick/mir_to_lir.h index 9a5617153..70785dcee 100644 --- a/compiler/dex/quick/mir_to_lir.h +++ b/compiler/dex/quick/mir_to_lir.h @@ -490,9 +490,9 @@ class Mir2Lir { class LIRSlowPath : public ArenaObject { public: - LIRSlowPath(Mir2Lir* m2l, const DexOffset dexpc, LIR* fromfast, - LIR* cont = nullptr) : - m2l_(m2l), cu_(m2l->cu_), current_dex_pc_(dexpc), fromfast_(fromfast), cont_(cont) { + LIRSlowPath(Mir2Lir* m2l, LIR* fromfast, LIR* cont = nullptr) + : m2l_(m2l), cu_(m2l->cu_), current_dex_pc_(m2l->current_dalvik_offset_), + fromfast_(fromfast), cont_(cont) { } virtual ~LIRSlowPath() {} virtual void Compile() = 0; diff --git a/compiler/dex/quick/x86/call_x86.cc b/compiler/dex/quick/x86/call_x86.cc index 11c146549..abee87254 100644 --- a/compiler/dex/quick/x86/call_x86.cc +++ b/compiler/dex/quick/x86/call_x86.cc @@ -193,7 +193,7 @@ void X86Mir2Lir::GenEntrySequence(RegLocation* ArgLocs, RegLocation rl_method) { class StackOverflowSlowPath : public LIRSlowPath { public: StackOverflowSlowPath(Mir2Lir* m2l, LIR* branch, size_t sp_displace) - : LIRSlowPath(m2l, m2l->GetCurrentDexPc(), branch, nullptr), sp_displace_(sp_displace) { + : LIRSlowPath(m2l, branch), sp_displace_(sp_displace) { } void Compile() OVERRIDE { m2l_->ResetRegPool(); diff --git a/compiler/dex/quick/x86/int_x86.cc b/compiler/dex/quick/x86/int_x86.cc index 91168c78b..25e34e302 100755 --- a/compiler/dex/quick/x86/int_x86.cc +++ b/compiler/dex/quick/x86/int_x86.cc @@ -1412,7 +1412,7 @@ void X86Mir2Lir::GenArrayBoundsCheck(RegStorage index, public: ArrayBoundsCheckSlowPath(Mir2Lir* m2l, LIR* branch_in, RegStorage index_in, RegStorage array_base_in, int32_t len_offset_in) - : LIRSlowPath(m2l, m2l->GetCurrentDexPc(), branch_in), + : LIRSlowPath(m2l, branch_in), index_(index_in), array_base_(array_base_in), len_offset_(len_offset_in) { } @@ -1460,7 +1460,7 @@ void X86Mir2Lir::GenArrayBoundsCheck(int32_t index, public: ArrayBoundsCheckSlowPath(Mir2Lir* m2l, LIR* branch_in, int32_t index_in, RegStorage array_base_in, int32_t len_offset_in) - : LIRSlowPath(m2l, m2l->GetCurrentDexPc(), branch_in), + : LIRSlowPath(m2l, branch_in), index_(index_in), array_base_(array_base_in), len_offset_(len_offset_in) { } -- 2.11.0