diff options
author | Sebastien Hertz <shertz@google.com> | 2013-06-27 07:37:19 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-06-27 07:37:20 +0000 |
commit | 48fcf64a2d8ecc993e64d7b349b10d3b066724ae (patch) | |
tree | 3d1041b9ba97f3f6fd328473e280fc88ae0c0bd9 /src | |
parent | e53ebbcf98d004f0e1f631a630d0344d104e3dc6 (diff) | |
parent | 0a3b863fb1acae912b54f4be2c1928d3afa5e936 (diff) | |
download | android_art-48fcf64a2d8ecc993e64d7b349b10d3b066724ae.tar.gz android_art-48fcf64a2d8ecc993e64d7b349b10d3b066724ae.tar.bz2 android_art-48fcf64a2d8ecc993e64d7b349b10d3b066724ae.zip |
Merge "Remove unused Thread parameter from ThrowArithmeticExceptionDivideByZero." into dalvik-dev
Diffstat (limited to 'src')
-rw-r--r-- | src/common_throws.cc | 2 | ||||
-rw-r--r-- | src/common_throws.h | 2 | ||||
-rw-r--r-- | src/compiler/llvm/runtime_support_llvm.cc | 2 | ||||
-rw-r--r-- | src/interpreter/interpreter.cc | 52 | ||||
-rw-r--r-- | src/oat/runtime/support_throw.cc | 2 |
5 files changed, 32 insertions, 28 deletions
diff --git a/src/common_throws.cc b/src/common_throws.cc index 1e114bb6dd..66e512eef3 100644 --- a/src/common_throws.cc +++ b/src/common_throws.cc @@ -68,7 +68,7 @@ static void ThrowException(const ThrowLocation* throw_location, const char* exce // 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 00d89f45f6..fbaf4c199f 100644 --- a/src/common_throws.h +++ b/src/common_throws.h @@ -32,7 +32,7 @@ class ThrowLocation; // 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 f3cfb33248..bff13f9dc9 100644 --- a/src/compiler/llvm/runtime_support_llvm.cc +++ b/src/compiler/llvm/runtime_support_llvm.cc @@ -177,7 +177,7 @@ bool art_portable_is_exception_pending_from_code() { } 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 685ca219b2..0e9bc78a93 100644 --- a/src/interpreter/interpreter.cc +++ b/src/interpreter/interpreter.cc @@ -767,10 +767,11 @@ static inline String* ResolveString(Thread* self, MethodHelper& mh, uint32_t str 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 DoIntDivide(Thread* self, ShadowFrame& shadow_frame, size_t r } } -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 DoIntRemainder(Thread* self, ShadowFrame& shadow_frame, size_ } } -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 DoLongDivide(Thread* self, ShadowFrame& shadow_frame, size_t } } -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 @@ static JValue ExecuteImpl(Thread* self, MethodHelper& mh, const DexFile::CodeIte 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 @@ static JValue ExecuteImpl(Thread* self, MethodHelper& mh, const DexFile::CodeIte 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 @@ static JValue ExecuteImpl(Thread* self, MethodHelper& mh, const DexFile::CodeIte 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 @@ static JValue ExecuteImpl(Thread* self, MethodHelper& mh, const DexFile::CodeIte 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 @@ static JValue ExecuteImpl(Thread* self, MethodHelper& mh, const DexFile::CodeIte 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 @@ static JValue ExecuteImpl(Thread* self, MethodHelper& mh, const DexFile::CodeIte 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 @@ static JValue ExecuteImpl(Thread* self, MethodHelper& mh, const DexFile::CodeIte 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 @@ static JValue ExecuteImpl(Thread* self, MethodHelper& mh, const DexFile::CodeIte 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 b8c68a565c..9588698bb2 100644 --- a/src/oat/runtime/support_throw.cc +++ b/src/oat/runtime/support_throw.cc @@ -67,7 +67,7 @@ extern "C" void artThrowDivZeroFromCode(Thread* self, mirror::AbstractMethod** sp) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { FinishCalleeSaveFrameSetup(self, sp, Runtime::kSaveAll); - ThrowArithmeticExceptionDivideByZero(self); + ThrowArithmeticExceptionDivideByZero(); self->QuickDeliverException(); } |