Quick: Clean up slow paths.
Change-Id: I278d42be77b02778c4a419ae9024b37929915b64
diff --git a/compiler/dex/quick/arm/call_arm.cc b/compiler/dex/quick/arm/call_arm.cc
index 1a9dbea..3182920 100644
--- a/compiler/dex/quick/arm/call_arm.cc
+++ b/compiler/dex/quick/arm/call_arm.cc
@@ -433,7 +433,7 @@
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 8275162..1dcbe60 100644
--- a/compiler/dex/quick/arm64/call_arm64.cc
+++ b/compiler/dex/quick/arm64/call_arm64.cc
@@ -351,8 +351,8 @@
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 32a469d..d613cca 100644
--- a/compiler/dex/quick/gen_common.cc
+++ b/compiler/dex/quick/gen_common.cc
@@ -86,7 +86,7 @@
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 @@
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 @@
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 @@
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 @@
// 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 @@
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 @@
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 @@
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 @@
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 @@
// 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 @@
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 6b553fd..2d41ba1 100755
--- a/compiler/dex/quick/gen_invoke.cc
+++ b/compiler/dex/quick/gen_invoke.cc
@@ -48,7 +48,8 @@
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 d9471f6..b067221 100644
--- a/compiler/dex/quick/mips/call_mips.cc
+++ b/compiler/dex/quick/mips/call_mips.cc
@@ -263,7 +263,7 @@
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 31be1c2..0e58770 100644
--- a/compiler/dex/quick/mips64/call_mips64.cc
+++ b/compiler/dex/quick/mips64/call_mips64.cc
@@ -268,7 +268,7 @@
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 8fc45dc..afacee0 100644
--- a/compiler/dex/quick/mir_to_lir.cc
+++ b/compiler/dex/quick/mir_to_lir.cc
@@ -27,7 +27,7 @@
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 9a56171..70785dc 100644
--- a/compiler/dex/quick/mir_to_lir.h
+++ b/compiler/dex/quick/mir_to_lir.h
@@ -490,9 +490,9 @@
class LIRSlowPath : public ArenaObject<kArenaAllocSlowPaths> {
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 11c1465..abee872 100644
--- a/compiler/dex/quick/x86/call_x86.cc
+++ b/compiler/dex/quick/x86/call_x86.cc
@@ -193,7 +193,7 @@
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 91168c7..25e34e3 100755
--- a/compiler/dex/quick/x86/int_x86.cc
+++ b/compiler/dex/quick/x86/int_x86.cc
@@ -1412,7 +1412,7 @@
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 @@
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) {
}