diff options
| -rw-r--r-- | compiler/dex/pass_manager.cc | 2 | ||||
| -rw-r--r-- | compiler/driver/compiler_driver.cc | 5 | ||||
| -rw-r--r-- | compiler/optimizing/builder.cc | 2 | ||||
| -rw-r--r-- | runtime/arch/x86_64/quick_entrypoints_x86_64.S | 2 | ||||
| -rw-r--r-- | runtime/gc/heap.cc | 1 | ||||
| -rw-r--r-- | runtime/verifier/method_verifier.cc | 2 | ||||
| -rw-r--r-- | test/800-smali/expected.txt | 1 | ||||
| -rw-r--r-- | test/800-smali/smali/EmptySparseSwitch.smali | 17 | ||||
| -rw-r--r-- | test/800-smali/src/Main.java | 2 |
9 files changed, 27 insertions, 7 deletions
diff --git a/compiler/dex/pass_manager.cc b/compiler/dex/pass_manager.cc index 6d58f65b68..6377a6c07a 100644 --- a/compiler/dex/pass_manager.cc +++ b/compiler/dex/pass_manager.cc @@ -33,7 +33,7 @@ void PassManager::CreateDefaultPassList() { // Add each pass which isn't disabled into default_pass_list_. for (const auto* pass : passes_) { if (options_.GetDisablePassList().find(pass->GetName()) != std::string::npos) { - LOG(INFO) << "Skipping disabled pass " << pass->GetName(); + VLOG(compiler) << "Skipping disabled pass " << pass->GetName(); } else { default_pass_list_.push_back(pass); } diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index 34963a9675..100d49a99e 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -1398,8 +1398,11 @@ void CompilerDriver::GetCodeAndMethodForDirectCall(InvokeType* type, InvokeType } } else { bool method_in_image = heap->FindSpaceFromObject(method, false)->IsImageSpace(); - if (method_in_image || compiling_boot) { + if (method_in_image || compiling_boot || runtime->UseJit()) { // We know we must be able to get to the method in the image, so use that pointer. + // In the case where we are the JIT, we can always use direct pointers since we know where + // the method and its code are / will be. We don't sharpen to interpreter bridge since we + // check IsQuickToInterpreterBridge above. CHECK(!method->IsAbstract()); *type = sharp_type; *direct_method = force_relocations ? -1 : reinterpret_cast<uintptr_t>(method); diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc index 2cac93dd8c..ec7fd62975 100644 --- a/compiler/optimizing/builder.cc +++ b/compiler/optimizing/builder.cc @@ -1024,8 +1024,6 @@ void HGraphBuilder::BuildSparseSwitch(const Instruction& instruction, uint32_t d HInstruction* value = LoadLocal(instruction.VRegA(), Primitive::kPrimInt); uint16_t num_entries = table.GetNumEntries(); - // There should be at least one entry here. - DCHECK_GT(num_entries, 0U); for (size_t i = 0; i < num_entries; i++) { BuildSwitchCaseHelper(instruction, i, i == static_cast<size_t>(num_entries) - 1, table, value, diff --git a/runtime/arch/x86_64/quick_entrypoints_x86_64.S b/runtime/arch/x86_64/quick_entrypoints_x86_64.S index 0629369477..5edcd96f59 100644 --- a/runtime/arch/x86_64/quick_entrypoints_x86_64.S +++ b/runtime/arch/x86_64/quick_entrypoints_x86_64.S @@ -916,7 +916,7 @@ DEFINE_FUNCTION art_quick_alloc_object_tlab SETUP_REFS_ONLY_CALLEE_SAVE_FRAME // save ref containing registers for GC // Outgoing argument set up movq %gs:THREAD_SELF_OFFSET, %rdx // pass Thread::Current() - call artAllocObjectFromCodeTLAB // cxx_name(arg0, arg1, Thread*) + call SYMBOL(artAllocObjectFromCodeTLAB) // cxx_name(arg0, arg1, Thread*) RESTORE_REFS_ONLY_CALLEE_SAVE_FRAME // restore frame up to return address RETURN_IF_RESULT_IS_NON_ZERO // return or deliver exception END_FUNCTION art_quick_alloc_object_tlab diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index dff8f4de7a..51cf558ab7 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -2061,7 +2061,6 @@ void Heap::PreZygoteFork() { MutexLock mu(self, zygote_creation_lock_); // Try to see if we have any Zygote spaces. if (HasZygoteSpace()) { - LOG(WARNING) << __FUNCTION__ << " called when we already have a zygote space."; return; } Runtime::Current()->GetInternTable()->SwapPostZygoteWithPreZygote(); diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc index 3b98e47010..47e9bf537b 100644 --- a/runtime/verifier/method_verifier.cc +++ b/runtime/verifier/method_verifier.cc @@ -1086,7 +1086,7 @@ bool MethodVerifier::CheckSwitchTargets(uint32_t cur_offset) { const uint16_t* insns = code_item_->insns_ + cur_offset; /* make sure the start of the switch is in range */ int32_t switch_offset = insns[1] | ((int32_t) insns[2]) << 16; - if ((int32_t) cur_offset + switch_offset < 0 || cur_offset + switch_offset + 2 >= insn_count) { + if ((int32_t) cur_offset + switch_offset < 0 || cur_offset + switch_offset + 2 > insn_count) { Fail(VERIFY_ERROR_BAD_CLASS_HARD) << "invalid switch start: at " << cur_offset << ", switch offset " << switch_offset << ", count " << insn_count; diff --git a/test/800-smali/expected.txt b/test/800-smali/expected.txt index 019dc14d24..5922257d01 100644 --- a/test/800-smali/expected.txt +++ b/test/800-smali/expected.txt @@ -14,4 +14,5 @@ b/18800943 (1) b/18800943 (2) MoveExc MoveExceptionOnEntry +EmptySparseSwitch Done! diff --git a/test/800-smali/smali/EmptySparseSwitch.smali b/test/800-smali/smali/EmptySparseSwitch.smali new file mode 100644 index 0000000000..29592c1208 --- /dev/null +++ b/test/800-smali/smali/EmptySparseSwitch.smali @@ -0,0 +1,17 @@ +.class public LEmptySparseSwitch; + +.super Ljava/lang/Object; + +.method public static run()V + .registers 2 + + const v0, 0 + + sparse-switch v0, :SparseSwitch + + return-void + + :SparseSwitch + .sparse-switch + .end sparse-switch +.end method diff --git a/test/800-smali/src/Main.java b/test/800-smali/src/Main.java index b23896d198..3e0b1f99ed 100644 --- a/test/800-smali/src/Main.java +++ b/test/800-smali/src/Main.java @@ -77,6 +77,8 @@ public class Main { null)); testCases.add(new TestCase("MoveExceptionOnEntry", "MoveExceptionOnEntry", "moveExceptionOnEntry", new Object[]{0}, new VerifyError(), null)); + testCases.add(new TestCase("EmptySparseSwitch", "EmptySparseSwitch", "run", null, null, + null)); } public void runTests() { |