Remove unused Thread parameter from ThrowArithmeticExceptionDivideByZero.
The "Thread* self" parameter of ThrowArithmeticExceptionDivideByZero is unused.
This CL removes it and updates all call sites.
Change-Id: I5cff86e97dd82dd07f4c174a3d8fbcf980da4aea
diff --git a/src/common_throws.cc b/src/common_throws.cc
index 1e114bb..66e512e 100644
--- a/src/common_throws.cc
+++ b/src/common_throws.cc
@@ -68,7 +68,7 @@
// ArithmeticException
-void ThrowArithmeticExceptionDivideByZero(Thread* self) {
+void ThrowArithmeticExceptionDivideByZero() {
ThrowException(NULL, "Ljava/lang/ArithmeticException;", NULL, "divide by zero");
}
diff --git a/src/common_throws.h b/src/common_throws.h
index 00d89f4..fbaf4c1 100644
--- a/src/common_throws.h
+++ b/src/common_throws.h
@@ -32,7 +32,7 @@
// ArithmeticException
-void ThrowArithmeticExceptionDivideByZero(Thread* self) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+void ThrowArithmeticExceptionDivideByZero() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
// ArrayIndexOutOfBoundsException
diff --git a/src/compiler/llvm/runtime_support_llvm.cc b/src/compiler/llvm/runtime_support_llvm.cc
index f3cfb33..bff13f9 100644
--- a/src/compiler/llvm/runtime_support_llvm.cc
+++ b/src/compiler/llvm/runtime_support_llvm.cc
@@ -177,7 +177,7 @@
}
void art_portable_throw_div_zero_from_code() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
- ThrowArithmeticExceptionDivideByZero(Thread::Current());
+ ThrowArithmeticExceptionDivideByZero();
}
void art_portable_throw_array_bounds_from_code(int32_t index, int32_t length)
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index 685ca21..0e9bc78 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -767,10 +767,11 @@
return mh.ResolveString(string_idx);
}
-static inline void DoIntDivide(Thread* self, ShadowFrame& shadow_frame, size_t result_reg,
- int32_t dividend, int32_t divisor) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+static inline void DoIntDivide(ShadowFrame& shadow_frame, size_t result_reg,
+ int32_t dividend, int32_t divisor)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
if (UNLIKELY(divisor == 0)) {
- ThrowArithmeticExceptionDivideByZero(self);
+ ThrowArithmeticExceptionDivideByZero();
} else if (UNLIKELY(dividend == kMinInt && divisor == -1)) {
shadow_frame.SetVReg(result_reg, kMinInt);
} else {
@@ -778,10 +779,11 @@
}
}
-static inline void DoIntRemainder(Thread* self, ShadowFrame& shadow_frame, size_t result_reg,
- int32_t dividend, int32_t divisor) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+static inline void DoIntRemainder(ShadowFrame& shadow_frame, size_t result_reg,
+ int32_t dividend, int32_t divisor)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
if (UNLIKELY(divisor == 0)) {
- ThrowArithmeticExceptionDivideByZero(self);
+ ThrowArithmeticExceptionDivideByZero();
} else if (UNLIKELY(dividend == kMinInt && divisor == -1)) {
shadow_frame.SetVReg(result_reg, 0);
} else {
@@ -789,10 +791,11 @@
}
}
-static inline void DoLongDivide(Thread* self, ShadowFrame& shadow_frame, size_t result_reg,
- int64_t dividend, int64_t divisor) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+static inline void DoLongDivide(ShadowFrame& shadow_frame, size_t result_reg,
+ int64_t dividend, int64_t divisor)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
if (UNLIKELY(divisor == 0)) {
- ThrowArithmeticExceptionDivideByZero(self);
+ ThrowArithmeticExceptionDivideByZero();
} else if (UNLIKELY(dividend == kMinLong && divisor == -1)) {
shadow_frame.SetVRegLong(result_reg, kMinLong);
} else {
@@ -800,10 +803,11 @@
}
}
-static inline void DoLongRemainder(Thread* self, ShadowFrame& shadow_frame, size_t result_reg,
- int64_t dividend, int64_t divisor) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+static inline void DoLongRemainder(ShadowFrame& shadow_frame, size_t result_reg,
+ int64_t dividend, int64_t divisor)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
if (UNLIKELY(divisor == 0)) {
- ThrowArithmeticExceptionDivideByZero(self);
+ ThrowArithmeticExceptionDivideByZero();
} else if (UNLIKELY(dividend == kMinLong && divisor == -1)) {
shadow_frame.SetVRegLong(result_reg, 0);
} else {
@@ -2302,14 +2306,14 @@
break;
case Instruction::DIV_INT:
PREAMBLE();
- DoIntDivide(self, shadow_frame, inst->VRegA_23x(),
+ DoIntDivide(shadow_frame, inst->VRegA_23x(),
shadow_frame.GetVReg(inst->VRegB_23x()),
shadow_frame.GetVReg(inst->VRegC_23x()));
POSSIBLY_HANDLE_PENDING_EXCEPTION(Next_2xx);
break;
case Instruction::REM_INT:
PREAMBLE();
- DoIntRemainder(self, shadow_frame, inst->VRegA_23x(),
+ DoIntRemainder(shadow_frame, inst->VRegA_23x(),
shadow_frame.GetVReg(inst->VRegB_23x()),
shadow_frame.GetVReg(inst->VRegC_23x()));
POSSIBLY_HANDLE_PENDING_EXCEPTION(Next_2xx);
@@ -2379,14 +2383,14 @@
break;
case Instruction::DIV_LONG:
PREAMBLE();
- DoLongDivide(self, shadow_frame, inst->VRegA_23x(),
+ DoLongDivide(shadow_frame, inst->VRegA_23x(),
shadow_frame.GetVRegLong(inst->VRegB_23x()),
shadow_frame.GetVRegLong(inst->VRegC_23x()));
POSSIBLY_HANDLE_PENDING_EXCEPTION(Next_2xx);
break;
case Instruction::REM_LONG:
PREAMBLE();
- DoLongRemainder(self, shadow_frame, inst->VRegA_23x(),
+ DoLongRemainder(shadow_frame, inst->VRegA_23x(),
shadow_frame.GetVRegLong(inst->VRegB_23x()),
shadow_frame.GetVRegLong(inst->VRegC_23x()));
POSSIBLY_HANDLE_PENDING_EXCEPTION(Next_2xx);
@@ -2533,7 +2537,7 @@
case Instruction::DIV_INT_2ADDR: {
PREAMBLE();
uint32_t vregA = inst->VRegA_12x();
- DoIntDivide(self, shadow_frame, vregA, shadow_frame.GetVReg(vregA),
+ DoIntDivide(shadow_frame, vregA, shadow_frame.GetVReg(vregA),
shadow_frame.GetVReg(inst->VRegB_12x()));
inst = inst->Next_1xx();
break;
@@ -2541,7 +2545,7 @@
case Instruction::REM_INT_2ADDR: {
PREAMBLE();
uint32_t vregA = inst->VRegA_12x();
- DoIntRemainder(self, shadow_frame, vregA, shadow_frame.GetVReg(vregA),
+ DoIntRemainder(shadow_frame, vregA, shadow_frame.GetVReg(vregA),
shadow_frame.GetVReg(inst->VRegB_12x()));
POSSIBLY_HANDLE_PENDING_EXCEPTION(Next_1xx);
break;
@@ -2630,7 +2634,7 @@
case Instruction::DIV_LONG_2ADDR: {
PREAMBLE();
uint32_t vregA = inst->VRegA_12x();
- DoLongDivide(self, shadow_frame, vregA, shadow_frame.GetVRegLong(vregA),
+ DoLongDivide(shadow_frame, vregA, shadow_frame.GetVRegLong(vregA),
shadow_frame.GetVRegLong(inst->VRegB_12x()));
POSSIBLY_HANDLE_PENDING_EXCEPTION(Next_1xx);
break;
@@ -2638,7 +2642,7 @@
case Instruction::REM_LONG_2ADDR: {
PREAMBLE();
uint32_t vregA = inst->VRegA_12x();
- DoLongRemainder(self, shadow_frame, vregA, shadow_frame.GetVRegLong(vregA),
+ DoLongRemainder(shadow_frame, vregA, shadow_frame.GetVRegLong(vregA),
shadow_frame.GetVRegLong(inst->VRegB_12x()));
POSSIBLY_HANDLE_PENDING_EXCEPTION(Next_1xx);
break;
@@ -2810,13 +2814,13 @@
break;
case Instruction::DIV_INT_LIT16:
PREAMBLE();
- DoIntDivide(self, shadow_frame, inst->VRegA_22s(),
+ DoIntDivide(shadow_frame, inst->VRegA_22s(),
shadow_frame.GetVReg(inst->VRegB_22s()), inst->VRegC_22s());
POSSIBLY_HANDLE_PENDING_EXCEPTION(Next_2xx);
break;
case Instruction::REM_INT_LIT16:
PREAMBLE();
- DoIntRemainder(self, shadow_frame, inst->VRegA_22s(),
+ DoIntRemainder(shadow_frame, inst->VRegA_22s(),
shadow_frame.GetVReg(inst->VRegB_22s()), inst->VRegC_22s());
POSSIBLY_HANDLE_PENDING_EXCEPTION(Next_2xx);
break;
@@ -2864,13 +2868,13 @@
break;
case Instruction::DIV_INT_LIT8:
PREAMBLE();
- DoIntDivide(self, shadow_frame, inst->VRegA_22b(),
+ DoIntDivide(shadow_frame, inst->VRegA_22b(),
shadow_frame.GetVReg(inst->VRegB_22b()), inst->VRegC_22b());
POSSIBLY_HANDLE_PENDING_EXCEPTION(Next_2xx);
break;
case Instruction::REM_INT_LIT8:
PREAMBLE();
- DoIntRemainder(self, shadow_frame, inst->VRegA_22b(),
+ DoIntRemainder(shadow_frame, inst->VRegA_22b(),
shadow_frame.GetVReg(inst->VRegB_22b()), inst->VRegC_22b());
POSSIBLY_HANDLE_PENDING_EXCEPTION(Next_2xx);
break;
diff --git a/src/oat/runtime/support_throw.cc b/src/oat/runtime/support_throw.cc
index b8c68a5..9588698 100644
--- a/src/oat/runtime/support_throw.cc
+++ b/src/oat/runtime/support_throw.cc
@@ -67,7 +67,7 @@
mirror::AbstractMethod** sp)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
FinishCalleeSaveFrameSetup(self, sp, Runtime::kSaveAll);
- ThrowArithmeticExceptionDivideByZero(self);
+ ThrowArithmeticExceptionDivideByZero();
self->QuickDeliverException();
}