From 2cebb24bfc3247d3e9be138a3350106737455918 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Tue, 21 Apr 2015 16:50:40 -0700 Subject: Replace NULL with nullptr Also fixed some lines that were too long, and a few other minor details. Change-Id: I6efba5fb6e03eb5d0a300fddb2a75bf8e2f175cb --- runtime/interpreter/interpreter.cc | 44 ++-- runtime/interpreter/interpreter_common.cc | 10 +- runtime/interpreter/interpreter_common.h | 4 +- runtime/interpreter/interpreter_goto_table_impl.cc | 277 +++++++++++++-------- runtime/interpreter/interpreter_switch_impl.cc | 264 ++++++++++++-------- runtime/interpreter/unstarted_runtime.cc | 2 +- 6 files changed, 372 insertions(+), 229 deletions(-) (limited to 'runtime/interpreter') diff --git a/runtime/interpreter/interpreter.cc b/runtime/interpreter/interpreter.cc index 4801124..423b952 100644 --- a/runtime/interpreter/interpreter.cc +++ b/runtime/interpreter/interpreter.cc @@ -78,7 +78,8 @@ static void InterpreterJni(Thread* self, ArtMethod* method, const StringPiece& s ScopedLocalRef klass(soa.Env(), soa.AddLocalReference(method->GetDeclaringClass())); ScopedLocalRef arg0(soa.Env(), - soa.AddLocalReference(reinterpret_cast(args[0]))); + soa.AddLocalReference( + reinterpret_cast(args[0]))); jobject jresult; { ScopedThreadStateChange tsc(self, kNative); @@ -99,12 +100,14 @@ static void InterpreterJni(Thread* self, ArtMethod* method, const StringPiece& s ScopedLocalRef klass(soa.Env(), soa.AddLocalReference(method->GetDeclaringClass())); ScopedLocalRef arg0(soa.Env(), - soa.AddLocalReference(reinterpret_cast(args[0]))); + soa.AddLocalReference( + reinterpret_cast(args[0]))); ScopedThreadStateChange tsc(self, kNative); result->SetI(fn(soa.Env(), klass.get(), arg0.get(), args[1])); } else if (shorty == "SIZ") { typedef jshort (fntype)(JNIEnv*, jclass, jint, jboolean); - fntype* const fn = reinterpret_cast(const_cast(method->GetEntryPointFromJni())); + fntype* const fn = + reinterpret_cast(const_cast(method->GetEntryPointFromJni())); ScopedLocalRef klass(soa.Env(), soa.AddLocalReference(method->GetDeclaringClass())); ScopedThreadStateChange tsc(self, kNative); @@ -122,9 +125,11 @@ static void InterpreterJni(Thread* self, ArtMethod* method, const StringPiece& s ScopedLocalRef klass(soa.Env(), soa.AddLocalReference(method->GetDeclaringClass())); ScopedLocalRef arg0(soa.Env(), - soa.AddLocalReference(reinterpret_cast(args[0]))); + soa.AddLocalReference( + reinterpret_cast(args[0]))); ScopedLocalRef arg1(soa.Env(), - soa.AddLocalReference(reinterpret_cast(args[1]))); + soa.AddLocalReference( + reinterpret_cast(args[1]))); ScopedThreadStateChange tsc(self, kNative); result->SetZ(fn(soa.Env(), klass.get(), arg0.get(), arg1.get())); } else if (shorty == "ZILL") { @@ -133,9 +138,11 @@ static void InterpreterJni(Thread* self, ArtMethod* method, const StringPiece& s ScopedLocalRef klass(soa.Env(), soa.AddLocalReference(method->GetDeclaringClass())); ScopedLocalRef arg1(soa.Env(), - soa.AddLocalReference(reinterpret_cast(args[1]))); + soa.AddLocalReference( + reinterpret_cast(args[1]))); ScopedLocalRef arg2(soa.Env(), - soa.AddLocalReference(reinterpret_cast(args[2]))); + soa.AddLocalReference( + reinterpret_cast(args[2]))); ScopedThreadStateChange tsc(self, kNative); result->SetZ(fn(soa.Env(), klass.get(), args[0], arg1.get(), arg2.get())); } else if (shorty == "VILII") { @@ -144,7 +151,8 @@ static void InterpreterJni(Thread* self, ArtMethod* method, const StringPiece& s ScopedLocalRef klass(soa.Env(), soa.AddLocalReference(method->GetDeclaringClass())); ScopedLocalRef arg1(soa.Env(), - soa.AddLocalReference(reinterpret_cast(args[1]))); + soa.AddLocalReference( + reinterpret_cast(args[1]))); ScopedThreadStateChange tsc(self, kNative); fn(soa.Env(), klass.get(), args[0], arg1.get(), args[2], args[3]); } else if (shorty == "VLILII") { @@ -153,9 +161,11 @@ static void InterpreterJni(Thread* self, ArtMethod* method, const StringPiece& s ScopedLocalRef klass(soa.Env(), soa.AddLocalReference(method->GetDeclaringClass())); ScopedLocalRef arg0(soa.Env(), - soa.AddLocalReference(reinterpret_cast(args[0]))); + soa.AddLocalReference( + reinterpret_cast(args[0]))); ScopedLocalRef arg2(soa.Env(), - soa.AddLocalReference(reinterpret_cast(args[2]))); + soa.AddLocalReference( + reinterpret_cast(args[2]))); ScopedThreadStateChange tsc(self, kNative); fn(soa.Env(), klass.get(), arg0.get(), args[1], arg2.get(), args[3], args[4]); } else { @@ -187,7 +197,8 @@ static void InterpreterJni(Thread* self, ArtMethod* method, const StringPiece& s ScopedLocalRef rcvr(soa.Env(), soa.AddLocalReference(receiver)); ScopedLocalRef arg0(soa.Env(), - soa.AddLocalReference(reinterpret_cast(args[0]))); + soa.AddLocalReference( + reinterpret_cast(args[0]))); jobject jresult; { ScopedThreadStateChange tsc(self, kNative); @@ -302,7 +313,7 @@ void EnterInterpreterFromInvoke(Thread* self, ArtMethod* method, Object* receive const DexFile::CodeItem* code_item = method->GetCodeItem(); uint16_t num_regs; uint16_t num_ins; - if (code_item != NULL) { + if (code_item != nullptr) { num_regs = code_item->registers_size_; num_ins = code_item->ins_size_; } else if (method->IsAbstract()) { @@ -325,7 +336,7 @@ void EnterInterpreterFromInvoke(Thread* self, ArtMethod* method, Object* receive size_t cur_reg = num_regs - num_ins; if (!method->IsStatic()) { - CHECK(receiver != NULL); + CHECK(receiver != nullptr); shadow_frame->SetVRegReference(cur_reg, receiver); ++cur_reg; } @@ -365,7 +376,7 @@ void EnterInterpreterFromInvoke(Thread* self, ArtMethod* method, Object* receive } if (LIKELY(!method->IsNative())) { JValue r = Execute(self, code_item, *shadow_frame, JValue()); - if (result != NULL) { + if (result != nullptr) { *result = r; } } else { @@ -386,8 +397,9 @@ void EnterInterpreterFromInvoke(Thread* self, ArtMethod* method, Object* receive void EnterInterpreterFromDeoptimize(Thread* self, ShadowFrame* shadow_frame, JValue* ret_val) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { JValue value; - value.SetJ(ret_val->GetJ()); // Set value to last known result in case the shadow frame chain is empty. - while (shadow_frame != NULL) { + // Set value to last known result in case the shadow frame chain is empty. + value.SetJ(ret_val->GetJ()); + while (shadow_frame != nullptr) { self->SetTopOfShadowStack(shadow_frame); const DexFile::CodeItem* code_item = shadow_frame->GetMethod()->GetCodeItem(); const uint32_t dex_pc = shadow_frame->GetDexPC(); diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc index 3ae611b..4765ebc 100644 --- a/runtime/interpreter/interpreter_common.cc +++ b/runtime/interpreter/interpreter_common.cc @@ -489,7 +489,7 @@ bool DoCall(ArtMethod* called_method, Thread* self, ShadowFrame& shadow_frame, const DexFile::CodeItem* code_item = called_method->GetCodeItem(); const uint16_t num_ins = (is_range) ? inst->VRegA_3rc(inst_data) : inst->VRegA_35c(inst_data); uint16_t num_regs; - if (LIKELY(code_item != NULL)) { + if (LIKELY(code_item != nullptr)) { num_regs = code_item->registers_size_; DCHECK_EQ(num_ins, code_item->ins_size_); } else { @@ -543,11 +543,11 @@ bool DoCall(ArtMethod* called_method, Thread* self, ShadowFrame& shadow_frame, switch (shorty[shorty_pos + 1]) { case 'L': { Object* o = shadow_frame.GetVRegReference(src_reg); - if (do_assignability_check && o != NULL) { + if (do_assignability_check && o != nullptr) { Class* arg_type = new_shadow_frame->GetMethod()->GetClassFromTypeIndex( params->GetTypeItem(shorty_pos).type_idx_, true); - if (arg_type == NULL) { + if (arg_type == nullptr) { CHECK(self->IsExceptionPending()); return false; } @@ -651,7 +651,7 @@ bool DoFilledNewArray(const Instruction* inst, const ShadowFrame& shadow_frame, uint16_t type_idx = is_range ? inst->VRegB_3rc() : inst->VRegB_35c(); Class* arrayClass = ResolveVerifyAndClinit(type_idx, shadow_frame.GetMethod(), self, false, do_access_check); - if (UNLIKELY(arrayClass == NULL)) { + if (UNLIKELY(arrayClass == nullptr)) { DCHECK(self->IsExceptionPending()); return false; } @@ -671,7 +671,7 @@ bool DoFilledNewArray(const Instruction* inst, const ShadowFrame& shadow_frame, Object* newArray = Array::Alloc(self, arrayClass, length, arrayClass->GetComponentSizeShift(), Runtime::Current()->GetHeap()->GetCurrentAllocator()); - if (UNLIKELY(newArray == NULL)) { + if (UNLIKELY(newArray == nullptr)) { DCHECK(self->IsExceptionPending()); return false; } diff --git a/runtime/interpreter/interpreter_common.h b/runtime/interpreter/interpreter_common.h index 0e0d56a..dbedc16 100644 --- a/runtime/interpreter/interpreter_common.h +++ b/runtime/interpreter/interpreter_common.h @@ -367,9 +367,9 @@ static inline void TraceExecution(const ShadowFrame& shadow_frame, const Instruc uint32_t raw_value = shadow_frame.GetVReg(i); Object* ref_value = shadow_frame.GetVRegReference(i); oss << StringPrintf(" vreg%u=0x%08X", i, raw_value); - if (ref_value != NULL) { + if (ref_value != nullptr) { if (ref_value->GetClass()->IsStringClass() && - ref_value->AsString()->GetCharArray() != NULL) { + ref_value->AsString()->GetCharArray() != nullptr) { oss << "/java.lang.String \"" << ref_value->AsString()->ToModifiedUtf8() << "\""; } else { oss << "/" << PrettyTypeOf(ref_value); diff --git a/runtime/interpreter/interpreter_goto_table_impl.cc b/runtime/interpreter/interpreter_goto_table_impl.cc index cead26c..dc0b687 100644 --- a/runtime/interpreter/interpreter_goto_table_impl.cc +++ b/runtime/interpreter/interpreter_goto_table_impl.cc @@ -55,7 +55,8 @@ namespace interpreter { } while (false) #define UPDATE_HANDLER_TABLE() \ - currentHandlersTable = handlersTable[Runtime::Current()->GetInstrumentation()->GetInterpreterHandlerTable()] + currentHandlersTable = handlersTable[ \ + Runtime::Current()->GetInstrumentation()->GetInterpreterHandlerTable()] #define BACKWARD_BRANCH_INSTRUMENTATION(offset) \ do { \ @@ -328,10 +329,10 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF self->AllowThreadSuspension(); const uint8_t vreg_index = inst->VRegA_11x(inst_data); Object* obj_result = shadow_frame.GetVRegReference(vreg_index); - if (do_assignability_check && obj_result != NULL) { + if (do_assignability_check && obj_result != nullptr) { Class* return_type = shadow_frame.GetMethod()->GetReturnType(); obj_result = shadow_frame.GetVRegReference(vreg_index); - if (return_type == NULL) { + if (return_type == nullptr) { // Return the pending exception. HANDLE_PENDING_EXCEPTION(); } @@ -364,7 +365,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF int32_t val = inst->VRegB_11n(inst_data); shadow_frame.SetVReg(dst, val); if (val == 0) { - shadow_frame.SetVRegReference(dst, NULL); + shadow_frame.SetVRegReference(dst, nullptr); } ADVANCE(1); } @@ -375,7 +376,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF int32_t val = inst->VRegB_21s(); shadow_frame.SetVReg(dst, val); if (val == 0) { - shadow_frame.SetVRegReference(dst, NULL); + shadow_frame.SetVRegReference(dst, nullptr); } ADVANCE(2); } @@ -386,7 +387,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF int32_t val = inst->VRegB_31i(); shadow_frame.SetVReg(dst, val); if (val == 0) { - shadow_frame.SetVRegReference(dst, NULL); + shadow_frame.SetVRegReference(dst, nullptr); } ADVANCE(3); } @@ -397,7 +398,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF int32_t val = static_cast(inst->VRegB_21h() << 16); shadow_frame.SetVReg(dst, val); if (val == 0) { - shadow_frame.SetVRegReference(dst, NULL); + shadow_frame.SetVRegReference(dst, nullptr); } ADVANCE(2); } @@ -426,7 +427,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_START(CONST_STRING) { String* s = ResolveString(self, shadow_frame, inst->VRegB_21c()); - if (UNLIKELY(s == NULL)) { + if (UNLIKELY(s == nullptr)) { HANDLE_PENDING_EXCEPTION(); } else { shadow_frame.SetVRegReference(inst->VRegA_21c(inst_data), s); @@ -437,7 +438,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_START(CONST_STRING_JUMBO) { String* s = ResolveString(self, shadow_frame, inst->VRegB_31c()); - if (UNLIKELY(s == NULL)) { + if (UNLIKELY(s == nullptr)) { HANDLE_PENDING_EXCEPTION(); } else { shadow_frame.SetVRegReference(inst->VRegA_31c(inst_data), s); @@ -449,7 +450,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_START(CONST_CLASS) { Class* c = ResolveVerifyAndClinit(inst->VRegB_21c(), shadow_frame.GetMethod(), self, false, do_access_check); - if (UNLIKELY(c == NULL)) { + if (UNLIKELY(c == nullptr)) { HANDLE_PENDING_EXCEPTION(); } else { shadow_frame.SetVRegReference(inst->VRegA_21c(inst_data), c); @@ -460,7 +461,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_START(MONITOR_ENTER) { Object* obj = shadow_frame.GetVRegReference(inst->VRegA_11x(inst_data)); - if (UNLIKELY(obj == NULL)) { + if (UNLIKELY(obj == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); } else { @@ -472,7 +473,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_START(MONITOR_EXIT) { Object* obj = shadow_frame.GetVRegReference(inst->VRegA_11x(inst_data)); - if (UNLIKELY(obj == NULL)) { + if (UNLIKELY(obj == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); } else { @@ -485,11 +486,11 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_START(CHECK_CAST) { Class* c = ResolveVerifyAndClinit(inst->VRegB_21c(), shadow_frame.GetMethod(), self, false, do_access_check); - if (UNLIKELY(c == NULL)) { + if (UNLIKELY(c == nullptr)) { HANDLE_PENDING_EXCEPTION(); } else { Object* obj = shadow_frame.GetVRegReference(inst->VRegA_21c(inst_data)); - if (UNLIKELY(obj != NULL && !obj->InstanceOf(c))) { + if (UNLIKELY(obj != nullptr && !obj->InstanceOf(c))) { ThrowClassCastException(c, obj->GetClass()); HANDLE_PENDING_EXCEPTION(); } else { @@ -502,11 +503,11 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_START(INSTANCE_OF) { Class* c = ResolveVerifyAndClinit(inst->VRegC_22c(), shadow_frame.GetMethod(), self, false, do_access_check); - if (UNLIKELY(c == NULL)) { + if (UNLIKELY(c == nullptr)) { HANDLE_PENDING_EXCEPTION(); } else { Object* obj = shadow_frame.GetVRegReference(inst->VRegB_22c(inst_data)); - shadow_frame.SetVReg(inst->VRegA_22c(inst_data), (obj != NULL && obj->InstanceOf(c)) ? 1 : 0); + shadow_frame.SetVReg(inst->VRegA_22c(inst_data), (obj != nullptr && obj->InstanceOf(c)) ? 1 : 0); ADVANCE(2); } } @@ -514,7 +515,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_START(ARRAY_LENGTH) { Object* array = shadow_frame.GetVRegReference(inst->VRegB_12x(inst_data)); - if (UNLIKELY(array == NULL)) { + if (UNLIKELY(array == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); } else { @@ -529,7 +530,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF Object* obj = AllocObjectFromCode( inst->VRegB_21c(), shadow_frame.GetMethod(), self, runtime->GetHeap()->GetCurrentAllocator()); - if (UNLIKELY(obj == NULL)) { + if (UNLIKELY(obj == nullptr)) { HANDLE_PENDING_EXCEPTION(); } else { obj->GetClass()->AssertInitializedOrInitializingInThread(self); @@ -551,7 +552,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF Object* obj = AllocArrayFromCode( inst->VRegC_22c(), length, shadow_frame.GetMethod(), self, Runtime::Current()->GetHeap()->GetCurrentAllocator()); - if (UNLIKELY(obj == NULL)) { + if (UNLIKELY(obj == nullptr)) { HANDLE_PENDING_EXCEPTION(); } else { shadow_frame.SetVRegReference(inst->VRegA_22c(inst_data), obj); @@ -591,7 +592,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_START(THROW) { Object* exception = shadow_frame.GetVRegReference(inst->VRegA_11x(inst_data)); - if (UNLIKELY(exception == NULL)) { + if (UNLIKELY(exception == nullptr)) { ThrowNullPointerException("throw with null exception"); } else if (do_assignability_check && !exception->GetClass()->IsThrowableClass()) { // This should never happen. @@ -778,7 +779,8 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(IF_NE) { - if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) != shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) { + if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) != + shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) { int16_t offset = inst->VRegC_22t(); if (IsBackwardBranch(offset)) { BACKWARD_BRANCH_INSTRUMENTATION(offset); @@ -795,7 +797,8 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(IF_LT) { - if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) < shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) { + if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) < + shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) { int16_t offset = inst->VRegC_22t(); if (IsBackwardBranch(offset)) { BACKWARD_BRANCH_INSTRUMENTATION(offset); @@ -812,7 +815,8 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(IF_GE) { - if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) >= shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) { + if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) >= + shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) { int16_t offset = inst->VRegC_22t(); if (IsBackwardBranch(offset)) { BACKWARD_BRANCH_INSTRUMENTATION(offset); @@ -829,7 +833,8 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(IF_GT) { - if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) > shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) { + if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) > + shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) { int16_t offset = inst->VRegC_22t(); if (IsBackwardBranch(offset)) { BACKWARD_BRANCH_INSTRUMENTATION(offset); @@ -846,7 +851,8 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(IF_LE) { - if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) <= shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) { + if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) <= + shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) { int16_t offset = inst->VRegC_22t(); if (IsBackwardBranch(offset)) { BACKWARD_BRANCH_INSTRUMENTATION(offset); @@ -966,7 +972,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_START(AGET_BOOLEAN) { Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); } else { @@ -984,7 +990,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_START(AGET_BYTE) { Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); } else { @@ -1002,7 +1008,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_START(AGET_CHAR) { Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); } else { @@ -1020,7 +1026,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_START(AGET_SHORT) { Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); } else { @@ -1038,7 +1044,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_START(AGET) { Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); } else { @@ -1056,7 +1062,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_START(AGET_WIDE) { Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); } else { @@ -1074,7 +1080,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_START(AGET_OBJECT) { Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); } else { @@ -1092,7 +1098,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_START(APUT_BOOLEAN) { Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); } else { @@ -1111,7 +1117,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_START(APUT_BYTE) { Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); } else { @@ -1130,7 +1136,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_START(APUT_CHAR) { Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); } else { @@ -1149,7 +1155,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_START(APUT_SHORT) { Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); } else { @@ -1168,7 +1174,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_START(APUT) { Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); } else { @@ -1187,7 +1193,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_START(APUT_WIDE) { Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); } else { @@ -1206,7 +1212,7 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_START(APUT_OBJECT) { Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); } else { @@ -1224,43 +1230,50 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(IGET_BOOLEAN) { - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(IGET_BYTE) { - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(IGET_CHAR) { - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(IGET_SHORT) { - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(IGET) { - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(IGET_WIDE) { - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(IGET_OBJECT) { - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); @@ -1308,314 +1321,366 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(SGET_BOOLEAN) { - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(SGET_BYTE) { - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(SGET_CHAR) { - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(SGET_SHORT) { - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(SGET) { - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(SGET_WIDE) { - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(SGET_OBJECT) { - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(IPUT_BOOLEAN) { - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(IPUT_BYTE) { - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(IPUT_CHAR) { - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(IPUT_SHORT) { - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(IPUT) { - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(IPUT_WIDE) { - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(IPUT_OBJECT) { - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(IPUT_QUICK) { - bool success = DoIPutQuick(shadow_frame, inst, inst_data); + bool success = DoIPutQuick( + shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(IPUT_BOOLEAN_QUICK) { - bool success = DoIPutQuick(shadow_frame, inst, inst_data); + bool success = DoIPutQuick( + shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(IPUT_BYTE_QUICK) { - bool success = DoIPutQuick(shadow_frame, inst, inst_data); + bool success = DoIPutQuick( + shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(IPUT_CHAR_QUICK) { - bool success = DoIPutQuick(shadow_frame, inst, inst_data); + bool success = DoIPutQuick( + shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(IPUT_SHORT_QUICK) { - bool success = DoIPutQuick(shadow_frame, inst, inst_data); + bool success = DoIPutQuick( + shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(IPUT_WIDE_QUICK) { - bool success = DoIPutQuick(shadow_frame, inst, inst_data); + bool success = DoIPutQuick( + shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(IPUT_OBJECT_QUICK) { - bool success = DoIPutQuick(shadow_frame, inst, inst_data); + bool success = DoIPutQuick( + shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(SPUT_BOOLEAN) { - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(SPUT_BYTE) { - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(SPUT_CHAR) { - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(SPUT_SHORT) { - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(SPUT) { - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(SPUT_WIDE) { - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(SPUT_OBJECT) { - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(INVOKE_VIRTUAL) { - bool success = DoInvoke(self, shadow_frame, inst, inst_data, &result_register); + bool success = DoInvoke( + self, shadow_frame, inst, inst_data, &result_register); UPDATE_HANDLER_TABLE(); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(INVOKE_VIRTUAL_RANGE) { - bool success = DoInvoke(self, shadow_frame, inst, inst_data, &result_register); + bool success = DoInvoke( + self, shadow_frame, inst, inst_data, &result_register); UPDATE_HANDLER_TABLE(); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(INVOKE_SUPER) { - bool success = DoInvoke(self, shadow_frame, inst, inst_data, &result_register); + bool success = DoInvoke( + self, shadow_frame, inst, inst_data, &result_register); UPDATE_HANDLER_TABLE(); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(INVOKE_SUPER_RANGE) { - bool success = DoInvoke(self, shadow_frame, inst, inst_data, &result_register); + bool success = DoInvoke( + self, shadow_frame, inst, inst_data, &result_register); UPDATE_HANDLER_TABLE(); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(INVOKE_DIRECT) { - bool success = DoInvoke(self, shadow_frame, inst, inst_data, &result_register); + bool success = DoInvoke( + self, shadow_frame, inst, inst_data, &result_register); UPDATE_HANDLER_TABLE(); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(INVOKE_DIRECT_RANGE) { - bool success = DoInvoke(self, shadow_frame, inst, inst_data, &result_register); + bool success = DoInvoke( + self, shadow_frame, inst, inst_data, &result_register); UPDATE_HANDLER_TABLE(); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(INVOKE_INTERFACE) { - bool success = DoInvoke(self, shadow_frame, inst, inst_data, &result_register); + bool success = DoInvoke( + self, shadow_frame, inst, inst_data, &result_register); UPDATE_HANDLER_TABLE(); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(INVOKE_INTERFACE_RANGE) { - bool success = DoInvoke(self, shadow_frame, inst, inst_data, &result_register); + bool success = DoInvoke( + self, shadow_frame, inst, inst_data, &result_register); UPDATE_HANDLER_TABLE(); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(INVOKE_STATIC) { - bool success = DoInvoke(self, shadow_frame, inst, inst_data, &result_register); + bool success = DoInvoke( + self, shadow_frame, inst, inst_data, &result_register); UPDATE_HANDLER_TABLE(); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(INVOKE_STATIC_RANGE) { - bool success = DoInvoke(self, shadow_frame, inst, inst_data, &result_register); + bool success = DoInvoke( + self, shadow_frame, inst, inst_data, &result_register); UPDATE_HANDLER_TABLE(); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(INVOKE_VIRTUAL_QUICK) { - bool success = DoInvokeVirtualQuick(self, shadow_frame, inst, inst_data, &result_register); + bool success = DoInvokeVirtualQuick( + self, shadow_frame, inst, inst_data, &result_register); UPDATE_HANDLER_TABLE(); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(INVOKE_VIRTUAL_RANGE_QUICK) { - bool success = DoInvokeVirtualQuick(self, shadow_frame, inst, inst_data, &result_register); + bool success = DoInvokeVirtualQuick( + self, shadow_frame, inst, inst_data, &result_register); UPDATE_HANDLER_TABLE(); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 3); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(NEG_INT) - shadow_frame.SetVReg(inst->VRegA_12x(inst_data), -shadow_frame.GetVReg(inst->VRegB_12x(inst_data))); + shadow_frame.SetVReg( + inst->VRegA_12x(inst_data), -shadow_frame.GetVReg(inst->VRegB_12x(inst_data))); ADVANCE(1); HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(NOT_INT) - shadow_frame.SetVReg(inst->VRegA_12x(inst_data), ~shadow_frame.GetVReg(inst->VRegB_12x(inst_data))); + shadow_frame.SetVReg( + inst->VRegA_12x(inst_data), ~shadow_frame.GetVReg(inst->VRegB_12x(inst_data))); ADVANCE(1); HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(NEG_LONG) - shadow_frame.SetVRegLong(inst->VRegA_12x(inst_data), -shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))); + shadow_frame.SetVRegLong( + inst->VRegA_12x(inst_data), -shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))); ADVANCE(1); HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(NOT_LONG) - shadow_frame.SetVRegLong(inst->VRegA_12x(inst_data), ~shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))); + shadow_frame.SetVRegLong( + inst->VRegA_12x(inst_data), ~shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))); ADVANCE(1); HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(NEG_FLOAT) - shadow_frame.SetVRegFloat(inst->VRegA_12x(inst_data), -shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data))); + shadow_frame.SetVRegFloat( + inst->VRegA_12x(inst_data), -shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data))); ADVANCE(1); HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(NEG_DOUBLE) - shadow_frame.SetVRegDouble(inst->VRegA_12x(inst_data), -shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data))); + shadow_frame.SetVRegDouble( + inst->VRegA_12x(inst_data), -shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data))); ADVANCE(1); HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(INT_TO_LONG) - shadow_frame.SetVRegLong(inst->VRegA_12x(inst_data), shadow_frame.GetVReg(inst->VRegB_12x(inst_data))); + shadow_frame.SetVRegLong( + inst->VRegA_12x(inst_data), shadow_frame.GetVReg(inst->VRegB_12x(inst_data))); ADVANCE(1); HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(INT_TO_FLOAT) - shadow_frame.SetVRegFloat(inst->VRegA_12x(inst_data), shadow_frame.GetVReg(inst->VRegB_12x(inst_data))); + shadow_frame.SetVRegFloat( + inst->VRegA_12x(inst_data), shadow_frame.GetVReg(inst->VRegB_12x(inst_data))); ADVANCE(1); HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(INT_TO_DOUBLE) - shadow_frame.SetVRegDouble(inst->VRegA_12x(inst_data), shadow_frame.GetVReg(inst->VRegB_12x(inst_data))); + shadow_frame.SetVRegDouble( + inst->VRegA_12x(inst_data), shadow_frame.GetVReg(inst->VRegB_12x(inst_data))); ADVANCE(1); HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(LONG_TO_INT) - shadow_frame.SetVReg(inst->VRegA_12x(inst_data), shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))); + shadow_frame.SetVReg( + inst->VRegA_12x(inst_data), shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))); ADVANCE(1); HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(LONG_TO_FLOAT) - shadow_frame.SetVRegFloat(inst->VRegA_12x(inst_data), shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))); + shadow_frame.SetVRegFloat( + inst->VRegA_12x(inst_data), shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))); ADVANCE(1); HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(LONG_TO_DOUBLE) - shadow_frame.SetVRegDouble(inst->VRegA_12x(inst_data), shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))); + shadow_frame.SetVRegDouble( + inst->VRegA_12x(inst_data), shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))); ADVANCE(1); HANDLE_INSTRUCTION_END(); @@ -1636,7 +1701,8 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(FLOAT_TO_DOUBLE) - shadow_frame.SetVRegDouble(inst->VRegA_12x(inst_data), shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data))); + shadow_frame.SetVRegDouble( + inst->VRegA_12x(inst_data), shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data))); ADVANCE(1); HANDLE_INSTRUCTION_END(); @@ -1657,7 +1723,8 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(DOUBLE_TO_FLOAT) - shadow_frame.SetVRegFloat(inst->VRegA_12x(inst_data), shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data))); + shadow_frame.SetVRegFloat( + inst->VRegA_12x(inst_data), shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data))); ADVANCE(1); HANDLE_INSTRUCTION_END(); @@ -2213,15 +2280,17 @@ JValue ExecuteGotoImpl(Thread* self, const DexFile::CodeItem* code_item, ShadowF HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(DIV_INT_LIT16) { - bool success = DoIntDivide(shadow_frame, inst->VRegA_22s(inst_data), - shadow_frame.GetVReg(inst->VRegB_22s(inst_data)), inst->VRegC_22s()); + bool success = DoIntDivide( + shadow_frame, inst->VRegA_22s(inst_data), shadow_frame.GetVReg(inst->VRegB_22s(inst_data)), + inst->VRegC_22s()); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); HANDLE_INSTRUCTION_START(REM_INT_LIT16) { - bool success = DoIntRemainder(shadow_frame, inst->VRegA_22s(inst_data), - shadow_frame.GetVReg(inst->VRegB_22s(inst_data)), inst->VRegC_22s()); + bool success = DoIntRemainder( + shadow_frame, inst->VRegA_22s(inst_data), shadow_frame.GetVReg(inst->VRegB_22s(inst_data)), + inst->VRegC_22s()); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, 2); } HANDLE_INSTRUCTION_END(); diff --git a/runtime/interpreter/interpreter_switch_impl.cc b/runtime/interpreter/interpreter_switch_impl.cc index fe7ad77..82f0009 100644 --- a/runtime/interpreter/interpreter_switch_impl.cc +++ b/runtime/interpreter/interpreter_switch_impl.cc @@ -68,7 +68,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, uint32_t dex_pc = shadow_frame.GetDexPC(); bool notified_method_entry_event = false; - const instrumentation::Instrumentation* const instrumentation = Runtime::Current()->GetInstrumentation(); + const auto* const instrumentation = Runtime::Current()->GetInstrumentation(); if (LIKELY(dex_pc == 0)) { // We are entering the method as opposed to deoptimizing. if (kIsDebugBuild) { self->AssertNoPendingException(); @@ -231,11 +231,11 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, self->AllowThreadSuspension(); const size_t ref_idx = inst->VRegA_11x(inst_data); Object* obj_result = shadow_frame.GetVRegReference(ref_idx); - if (do_assignability_check && obj_result != NULL) { + if (do_assignability_check && obj_result != nullptr) { Class* return_type = shadow_frame.GetMethod()->GetReturnType(); // Re-load since it might have moved. obj_result = shadow_frame.GetVRegReference(ref_idx); - if (return_type == NULL) { + if (return_type == nullptr) { // Return the pending exception. HANDLE_PENDING_EXCEPTION(); } @@ -266,7 +266,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, int4_t val = inst->VRegB_11n(inst_data); shadow_frame.SetVReg(dst, val); if (val == 0) { - shadow_frame.SetVRegReference(dst, NULL); + shadow_frame.SetVRegReference(dst, nullptr); } inst = inst->Next_1xx(); break; @@ -277,7 +277,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, int16_t val = inst->VRegB_21s(); shadow_frame.SetVReg(dst, val); if (val == 0) { - shadow_frame.SetVRegReference(dst, NULL); + shadow_frame.SetVRegReference(dst, nullptr); } inst = inst->Next_2xx(); break; @@ -288,7 +288,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, int32_t val = inst->VRegB_31i(); shadow_frame.SetVReg(dst, val); if (val == 0) { - shadow_frame.SetVRegReference(dst, NULL); + shadow_frame.SetVRegReference(dst, nullptr); } inst = inst->Next_3xx(); break; @@ -299,7 +299,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, int32_t val = static_cast(inst->VRegB_21h() << 16); shadow_frame.SetVReg(dst, val); if (val == 0) { - shadow_frame.SetVRegReference(dst, NULL); + shadow_frame.SetVRegReference(dst, nullptr); } inst = inst->Next_2xx(); break; @@ -328,7 +328,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, case Instruction::CONST_STRING: { PREAMBLE(); String* s = ResolveString(self, shadow_frame, inst->VRegB_21c()); - if (UNLIKELY(s == NULL)) { + if (UNLIKELY(s == nullptr)) { HANDLE_PENDING_EXCEPTION(); } else { shadow_frame.SetVRegReference(inst->VRegA_21c(inst_data), s); @@ -339,7 +339,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, case Instruction::CONST_STRING_JUMBO: { PREAMBLE(); String* s = ResolveString(self, shadow_frame, inst->VRegB_31c()); - if (UNLIKELY(s == NULL)) { + if (UNLIKELY(s == nullptr)) { HANDLE_PENDING_EXCEPTION(); } else { shadow_frame.SetVRegReference(inst->VRegA_31c(inst_data), s); @@ -351,7 +351,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, PREAMBLE(); Class* c = ResolveVerifyAndClinit(inst->VRegB_21c(), shadow_frame.GetMethod(), self, false, do_access_check); - if (UNLIKELY(c == NULL)) { + if (UNLIKELY(c == nullptr)) { HANDLE_PENDING_EXCEPTION(); } else { shadow_frame.SetVRegReference(inst->VRegA_21c(inst_data), c); @@ -362,7 +362,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, case Instruction::MONITOR_ENTER: { PREAMBLE(); Object* obj = shadow_frame.GetVRegReference(inst->VRegA_11x(inst_data)); - if (UNLIKELY(obj == NULL)) { + if (UNLIKELY(obj == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); } else { @@ -374,7 +374,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, case Instruction::MONITOR_EXIT: { PREAMBLE(); Object* obj = shadow_frame.GetVRegReference(inst->VRegA_11x(inst_data)); - if (UNLIKELY(obj == NULL)) { + if (UNLIKELY(obj == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); } else { @@ -387,11 +387,11 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, PREAMBLE(); Class* c = ResolveVerifyAndClinit(inst->VRegB_21c(), shadow_frame.GetMethod(), self, false, do_access_check); - if (UNLIKELY(c == NULL)) { + if (UNLIKELY(c == nullptr)) { HANDLE_PENDING_EXCEPTION(); } else { Object* obj = shadow_frame.GetVRegReference(inst->VRegA_21c(inst_data)); - if (UNLIKELY(obj != NULL && !obj->InstanceOf(c))) { + if (UNLIKELY(obj != nullptr && !obj->InstanceOf(c))) { ThrowClassCastException(c, obj->GetClass()); HANDLE_PENDING_EXCEPTION(); } else { @@ -404,11 +404,12 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, PREAMBLE(); Class* c = ResolveVerifyAndClinit(inst->VRegC_22c(), shadow_frame.GetMethod(), self, false, do_access_check); - if (UNLIKELY(c == NULL)) { + if (UNLIKELY(c == nullptr)) { HANDLE_PENDING_EXCEPTION(); } else { Object* obj = shadow_frame.GetVRegReference(inst->VRegB_22c(inst_data)); - shadow_frame.SetVReg(inst->VRegA_22c(inst_data), (obj != NULL && obj->InstanceOf(c)) ? 1 : 0); + shadow_frame.SetVReg(inst->VRegA_22c(inst_data), + (obj != nullptr && obj->InstanceOf(c)) ? 1 : 0); inst = inst->Next_2xx(); } break; @@ -416,7 +417,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, case Instruction::ARRAY_LENGTH: { PREAMBLE(); Object* array = shadow_frame.GetVRegReference(inst->VRegB_12x(inst_data)); - if (UNLIKELY(array == NULL)) { + if (UNLIKELY(array == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); } else { @@ -431,7 +432,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, Object* obj = AllocObjectFromCode( inst->VRegB_21c(), shadow_frame.GetMethod(), self, runtime->GetHeap()->GetCurrentAllocator()); - if (UNLIKELY(obj == NULL)) { + if (UNLIKELY(obj == nullptr)) { HANDLE_PENDING_EXCEPTION(); } else { obj->GetClass()->AssertInitializedOrInitializingInThread(self); @@ -454,7 +455,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, Object* obj = AllocArrayFromCode( inst->VRegC_22c(), length, shadow_frame.GetMethod(), self, Runtime::Current()->GetHeap()->GetCurrentAllocator()); - if (UNLIKELY(obj == NULL)) { + if (UNLIKELY(obj == nullptr)) { HANDLE_PENDING_EXCEPTION(); } else { shadow_frame.SetVRegReference(inst->VRegA_22c(inst_data), obj); @@ -498,7 +499,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, case Instruction::THROW: { PREAMBLE(); Object* exception = shadow_frame.GetVRegReference(inst->VRegA_11x(inst_data)); - if (UNLIKELY(exception == NULL)) { + if (UNLIKELY(exception == nullptr)) { ThrowNullPointerException("throw with null exception"); } else if (do_assignability_check && !exception->GetClass()->IsThrowableClass()) { // This should never happen. @@ -651,7 +652,8 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, } case Instruction::IF_EQ: { PREAMBLE(); - if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) == shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) { + if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) == + shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) { int16_t offset = inst->VRegC_22t(); if (IsBackwardBranch(offset)) { self->AllowThreadSuspension(); @@ -664,7 +666,8 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, } case Instruction::IF_NE: { PREAMBLE(); - if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) != shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) { + if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) != + shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) { int16_t offset = inst->VRegC_22t(); if (IsBackwardBranch(offset)) { self->AllowThreadSuspension(); @@ -677,7 +680,8 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, } case Instruction::IF_LT: { PREAMBLE(); - if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) < shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) { + if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) < + shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) { int16_t offset = inst->VRegC_22t(); if (IsBackwardBranch(offset)) { self->AllowThreadSuspension(); @@ -690,7 +694,8 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, } case Instruction::IF_GE: { PREAMBLE(); - if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) >= shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) { + if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) >= + shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) { int16_t offset = inst->VRegC_22t(); if (IsBackwardBranch(offset)) { self->AllowThreadSuspension(); @@ -703,7 +708,8 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, } case Instruction::IF_GT: { PREAMBLE(); - if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) > shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) { + if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) > + shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) { int16_t offset = inst->VRegC_22t(); if (IsBackwardBranch(offset)) { self->AllowThreadSuspension(); @@ -716,7 +722,8 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, } case Instruction::IF_LE: { PREAMBLE(); - if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) <= shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) { + if (shadow_frame.GetVReg(inst->VRegA_22t(inst_data)) <= + shadow_frame.GetVReg(inst->VRegB_22t(inst_data))) { int16_t offset = inst->VRegC_22t(); if (IsBackwardBranch(offset)) { self->AllowThreadSuspension(); @@ -808,7 +815,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, case Instruction::AGET_BOOLEAN: { PREAMBLE(); Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); break; @@ -826,7 +833,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, case Instruction::AGET_BYTE: { PREAMBLE(); Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); break; @@ -844,7 +851,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, case Instruction::AGET_CHAR: { PREAMBLE(); Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); break; @@ -862,7 +869,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, case Instruction::AGET_SHORT: { PREAMBLE(); Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); break; @@ -880,7 +887,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, case Instruction::AGET: { PREAMBLE(); Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); break; @@ -898,7 +905,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, case Instruction::AGET_WIDE: { PREAMBLE(); Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); break; @@ -916,7 +923,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, case Instruction::AGET_OBJECT: { PREAMBLE(); Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); break; @@ -934,7 +941,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, case Instruction::APUT_BOOLEAN: { PREAMBLE(); Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); break; @@ -953,7 +960,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, case Instruction::APUT_BYTE: { PREAMBLE(); Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); break; @@ -972,7 +979,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, case Instruction::APUT_CHAR: { PREAMBLE(); Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); break; @@ -991,7 +998,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, case Instruction::APUT_SHORT: { PREAMBLE(); Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); break; @@ -1010,7 +1017,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, case Instruction::APUT: { PREAMBLE(); Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); break; @@ -1029,7 +1036,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, case Instruction::APUT_WIDE: { PREAMBLE(); Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); break; @@ -1048,7 +1055,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, case Instruction::APUT_OBJECT: { PREAMBLE(); Object* a = shadow_frame.GetVRegReference(inst->VRegB_23x()); - if (UNLIKELY(a == NULL)) { + if (UNLIKELY(a == nullptr)) { ThrowNullPointerExceptionFromInterpreter(); HANDLE_PENDING_EXCEPTION(); break; @@ -1066,43 +1073,50 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, } case Instruction::IGET_BOOLEAN: { PREAMBLE(); - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::IGET_BYTE: { PREAMBLE(); - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::IGET_CHAR: { PREAMBLE(); - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::IGET_SHORT: { PREAMBLE(); - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::IGET: { PREAMBLE(); - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::IGET_WIDE: { PREAMBLE(); - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::IGET_OBJECT: { PREAMBLE(); - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } @@ -1150,272 +1164,318 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, } case Instruction::SGET_BOOLEAN: { PREAMBLE(); - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::SGET_BYTE: { PREAMBLE(); - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::SGET_CHAR: { PREAMBLE(); - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::SGET_SHORT: { PREAMBLE(); - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::SGET: { PREAMBLE(); - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::SGET_WIDE: { PREAMBLE(); - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::SGET_OBJECT: { PREAMBLE(); - bool success = DoFieldGet(self, shadow_frame, inst, inst_data); + bool success = DoFieldGet( + self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::IPUT_BOOLEAN: { PREAMBLE(); - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::IPUT_BYTE: { PREAMBLE(); - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::IPUT_CHAR: { PREAMBLE(); - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::IPUT_SHORT: { PREAMBLE(); - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::IPUT: { PREAMBLE(); - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::IPUT_WIDE: { PREAMBLE(); - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::IPUT_OBJECT: { PREAMBLE(); - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::IPUT_QUICK: { PREAMBLE(); - bool success = DoIPutQuick(shadow_frame, inst, inst_data); + bool success = DoIPutQuick( + shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::IPUT_BOOLEAN_QUICK: { PREAMBLE(); - bool success = DoIPutQuick(shadow_frame, inst, inst_data); + bool success = DoIPutQuick( + shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::IPUT_BYTE_QUICK: { PREAMBLE(); - bool success = DoIPutQuick(shadow_frame, inst, inst_data); + bool success = DoIPutQuick( + shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::IPUT_CHAR_QUICK: { PREAMBLE(); - bool success = DoIPutQuick(shadow_frame, inst, inst_data); + bool success = DoIPutQuick( + shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::IPUT_SHORT_QUICK: { PREAMBLE(); - bool success = DoIPutQuick(shadow_frame, inst, inst_data); + bool success = DoIPutQuick( + shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::IPUT_WIDE_QUICK: { PREAMBLE(); - bool success = DoIPutQuick(shadow_frame, inst, inst_data); + bool success = DoIPutQuick( + shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::IPUT_OBJECT_QUICK: { PREAMBLE(); - bool success = DoIPutQuick(shadow_frame, inst, inst_data); + bool success = DoIPutQuick( + shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::SPUT_BOOLEAN: { PREAMBLE(); - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::SPUT_BYTE: { PREAMBLE(); - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::SPUT_CHAR: { PREAMBLE(); - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::SPUT_SHORT: { PREAMBLE(); - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::SPUT: { PREAMBLE(); - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::SPUT_WIDE: { PREAMBLE(); - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::SPUT_OBJECT: { PREAMBLE(); - bool success = DoFieldPut(self, shadow_frame, inst, inst_data); + bool success = DoFieldPut(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::INVOKE_VIRTUAL: { PREAMBLE(); - bool success = DoInvoke(self, shadow_frame, inst, inst_data, &result_register); + bool success = DoInvoke( + self, shadow_frame, inst, inst_data, &result_register); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx); break; } case Instruction::INVOKE_VIRTUAL_RANGE: { PREAMBLE(); - bool success = DoInvoke(self, shadow_frame, inst, inst_data, &result_register); + bool success = DoInvoke( + self, shadow_frame, inst, inst_data, &result_register); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx); break; } case Instruction::INVOKE_SUPER: { PREAMBLE(); - bool success = DoInvoke(self, shadow_frame, inst, inst_data, &result_register); + bool success = DoInvoke( + self, shadow_frame, inst, inst_data, &result_register); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx); break; } case Instruction::INVOKE_SUPER_RANGE: { PREAMBLE(); - bool success = DoInvoke(self, shadow_frame, inst, inst_data, &result_register); + bool success = DoInvoke( + self, shadow_frame, inst, inst_data, &result_register); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx); break; } case Instruction::INVOKE_DIRECT: { PREAMBLE(); - bool success = DoInvoke(self, shadow_frame, inst, inst_data, &result_register); + bool success = DoInvoke( + self, shadow_frame, inst, inst_data, &result_register); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx); break; } case Instruction::INVOKE_DIRECT_RANGE: { PREAMBLE(); - bool success = DoInvoke(self, shadow_frame, inst, inst_data, &result_register); + bool success = DoInvoke( + self, shadow_frame, inst, inst_data, &result_register); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx); break; } case Instruction::INVOKE_INTERFACE: { PREAMBLE(); - bool success = DoInvoke(self, shadow_frame, inst, inst_data, &result_register); + bool success = DoInvoke( + self, shadow_frame, inst, inst_data, &result_register); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx); break; } case Instruction::INVOKE_INTERFACE_RANGE: { PREAMBLE(); - bool success = DoInvoke(self, shadow_frame, inst, inst_data, &result_register); + bool success = DoInvoke( + self, shadow_frame, inst, inst_data, &result_register); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx); break; } case Instruction::INVOKE_STATIC: { PREAMBLE(); - bool success = DoInvoke(self, shadow_frame, inst, inst_data, &result_register); + bool success = DoInvoke( + self, shadow_frame, inst, inst_data, &result_register); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx); break; } case Instruction::INVOKE_STATIC_RANGE: { PREAMBLE(); - bool success = DoInvoke(self, shadow_frame, inst, inst_data, &result_register); + bool success = DoInvoke( + self, shadow_frame, inst, inst_data, &result_register); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx); break; } case Instruction::INVOKE_VIRTUAL_QUICK: { PREAMBLE(); - bool success = DoInvokeVirtualQuick(self, shadow_frame, inst, inst_data, &result_register); + bool success = DoInvokeVirtualQuick( + self, shadow_frame, inst, inst_data, &result_register); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx); break; } case Instruction::INVOKE_VIRTUAL_RANGE_QUICK: { PREAMBLE(); - bool success = DoInvokeVirtualQuick(self, shadow_frame, inst, inst_data, &result_register); + bool success = DoInvokeVirtualQuick( + self, shadow_frame, inst, inst_data, &result_register); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx); break; } case Instruction::NEG_INT: PREAMBLE(); - shadow_frame.SetVReg(inst->VRegA_12x(inst_data), -shadow_frame.GetVReg(inst->VRegB_12x(inst_data))); + shadow_frame.SetVReg( + inst->VRegA_12x(inst_data), -shadow_frame.GetVReg(inst->VRegB_12x(inst_data))); inst = inst->Next_1xx(); break; case Instruction::NOT_INT: PREAMBLE(); - shadow_frame.SetVReg(inst->VRegA_12x(inst_data), ~shadow_frame.GetVReg(inst->VRegB_12x(inst_data))); + shadow_frame.SetVReg( + inst->VRegA_12x(inst_data), ~shadow_frame.GetVReg(inst->VRegB_12x(inst_data))); inst = inst->Next_1xx(); break; case Instruction::NEG_LONG: PREAMBLE(); - shadow_frame.SetVRegLong(inst->VRegA_12x(inst_data), -shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))); + shadow_frame.SetVRegLong( + inst->VRegA_12x(inst_data), -shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))); inst = inst->Next_1xx(); break; case Instruction::NOT_LONG: PREAMBLE(); - shadow_frame.SetVRegLong(inst->VRegA_12x(inst_data), ~shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))); + shadow_frame.SetVRegLong( + inst->VRegA_12x(inst_data), ~shadow_frame.GetVRegLong(inst->VRegB_12x(inst_data))); inst = inst->Next_1xx(); break; case Instruction::NEG_FLOAT: PREAMBLE(); - shadow_frame.SetVRegFloat(inst->VRegA_12x(inst_data), -shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data))); + shadow_frame.SetVRegFloat( + inst->VRegA_12x(inst_data), -shadow_frame.GetVRegFloat(inst->VRegB_12x(inst_data))); inst = inst->Next_1xx(); break; case Instruction::NEG_DOUBLE: PREAMBLE(); - shadow_frame.SetVRegDouble(inst->VRegA_12x(inst_data), -shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data))); + shadow_frame.SetVRegDouble( + inst->VRegA_12x(inst_data), -shadow_frame.GetVRegDouble(inst->VRegB_12x(inst_data))); inst = inst->Next_1xx(); break; case Instruction::INT_TO_LONG: @@ -1500,20 +1560,20 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, break; case Instruction::INT_TO_BYTE: PREAMBLE(); - shadow_frame.SetVReg(inst->VRegA_12x(inst_data), - static_cast(shadow_frame.GetVReg(inst->VRegB_12x(inst_data)))); + shadow_frame.SetVReg(inst->VRegA_12x(inst_data), static_cast( + shadow_frame.GetVReg(inst->VRegB_12x(inst_data)))); inst = inst->Next_1xx(); break; case Instruction::INT_TO_CHAR: PREAMBLE(); - shadow_frame.SetVReg(inst->VRegA_12x(inst_data), - static_cast(shadow_frame.GetVReg(inst->VRegB_12x(inst_data)))); + shadow_frame.SetVReg(inst->VRegA_12x(inst_data), static_cast( + shadow_frame.GetVReg(inst->VRegB_12x(inst_data)))); inst = inst->Next_1xx(); break; case Instruction::INT_TO_SHORT: PREAMBLE(); - shadow_frame.SetVReg(inst->VRegA_12x(inst_data), - static_cast(shadow_frame.GetVReg(inst->VRegB_12x(inst_data)))); + shadow_frame.SetVReg(inst->VRegA_12x(inst_data), static_cast( + shadow_frame.GetVReg(inst->VRegB_12x(inst_data)))); inst = inst->Next_1xx(); break; case Instruction::ADD_INT: { @@ -2050,14 +2110,16 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, case Instruction::DIV_INT_LIT16: { PREAMBLE(); bool success = DoIntDivide(shadow_frame, inst->VRegA_22s(inst_data), - shadow_frame.GetVReg(inst->VRegB_22s(inst_data)), inst->VRegC_22s()); + shadow_frame.GetVReg(inst->VRegB_22s(inst_data)), + inst->VRegC_22s()); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::REM_INT_LIT16: { PREAMBLE(); bool success = DoIntRemainder(shadow_frame, inst->VRegA_22s(inst_data), - shadow_frame.GetVReg(inst->VRegB_22s(inst_data)), inst->VRegC_22s()); + shadow_frame.GetVReg(inst->VRegB_22s(inst_data)), + inst->VRegC_22s()); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } diff --git a/runtime/interpreter/unstarted_runtime.cc b/runtime/interpreter/unstarted_runtime.cc index 61def35..f30c93a 100644 --- a/runtime/interpreter/unstarted_runtime.cc +++ b/runtime/interpreter/unstarted_runtime.cc @@ -915,7 +915,7 @@ static void UnstartedJNIArrayCreateObjectArray(Thread* self, Runtime* runtime = Runtime::Current(); ClassLinker* class_linker = runtime->GetClassLinker(); mirror::Class* array_class = class_linker->FindArrayClass(self, &element_class); - if (UNLIKELY(array_class == NULL)) { + if (UNLIKELY(array_class == nullptr)) { CHECK(self->IsExceptionPending()); return; } -- cgit v1.1