diff options
author | 2017-01-04 12:04:05 -0800 | |
---|---|---|
committer | 2017-01-04 13:26:05 -0800 | |
commit | 422c7c352adda88bcc96078641cb845fa3712292 (patch) | |
tree | b2745c140c7dd7afc3cb3743051a3c21cd4e3600 | |
parent | 001cd47ddd81e5bdd6cc2051beced4799124315a (diff) |
ART: Remove dequicken map from VerifiedMethod
Remove now unused VerifiedMethod's dequicken map. Follow-up to
c51c7ca7a779563d153c137c6bf01c3ea532a6c9.
Results on a large well-known app in speed compile with -j4:
Before:
dex2oat took [...] native alloc=84MB [...] swap=208MB [...]
After:
dex2oat took [...] native alloc=76MB [...] swap=208MB [...]
Bug: 34053922
Test: m clean-oat-host && m test-art-host
Change-Id: Ie95fd297299a0f5fac0c8c702773ee8372f662b6
-rw-r--r-- | compiler/dex/verified_method.cc | 43 | ||||
-rw-r--r-- | compiler/dex/verified_method.h | 10 |
2 files changed, 0 insertions, 53 deletions
diff --git a/compiler/dex/verified_method.cc b/compiler/dex/verified_method.cc index 188209bfb8..cbca33320d 100644 --- a/compiler/dex/verified_method.cc +++ b/compiler/dex/verified_method.cc @@ -59,49 +59,6 @@ bool VerifiedMethod::IsSafeCast(uint32_t pc) const { return std::binary_search(safe_cast_set_.begin(), safe_cast_set_.end(), pc); } -bool VerifiedMethod::GenerateDequickenMap(verifier::MethodVerifier* method_verifier) { - if (method_verifier->HasFailures()) { - return false; - } - const DexFile::CodeItem* code_item = method_verifier->CodeItem(); - const uint16_t* insns = code_item->insns_; - const Instruction* inst = Instruction::At(insns); - const Instruction* end = Instruction::At(insns + code_item->insns_size_in_code_units_); - for (; inst < end; inst = inst->Next()) { - const bool is_virtual_quick = inst->Opcode() == Instruction::INVOKE_VIRTUAL_QUICK; - const bool is_range_quick = inst->Opcode() == Instruction::INVOKE_VIRTUAL_RANGE_QUICK; - if (is_virtual_quick || is_range_quick) { - uint32_t dex_pc = inst->GetDexPc(insns); - verifier::RegisterLine* line = method_verifier->GetRegLine(dex_pc); - ArtMethod* method = - method_verifier->GetQuickInvokedMethod(inst, line, is_range_quick, true); - if (method == nullptr) { - // It can be null if the line wasn't verified since it was unreachable. - return false; - } - // The verifier must know what the type of the object was or else we would have gotten a - // failure. Put the dex method index in the dequicken map since we need this to get number of - // arguments in the compiler. - dequicken_map_.Put(dex_pc, DexFileReference(method->GetDexFile(), - method->GetDexMethodIndex())); - } else if (IsInstructionIGetQuickOrIPutQuick(inst->Opcode())) { - uint32_t dex_pc = inst->GetDexPc(insns); - verifier::RegisterLine* line = method_verifier->GetRegLine(dex_pc); - ArtField* field = method_verifier->GetQuickFieldAccess(inst, line); - if (field == nullptr) { - // It can be null if the line wasn't verified since it was unreachable. - return false; - } - // The verifier must know what the type of the field was or else we would have gotten a - // failure. Put the dex field index in the dequicken map since we need this for lowering - // in the compiler. - // TODO: Putting a field index in a method reference is gross. - dequicken_map_.Put(dex_pc, DexFileReference(field->GetDexFile(), field->GetDexFieldIndex())); - } - } - return true; -} - void VerifiedMethod::GenerateSafeCastSet(verifier::MethodVerifier* method_verifier) { /* * Walks over the method code and adds any cast instructions in which diff --git a/compiler/dex/verified_method.h b/compiler/dex/verified_method.h index 0530a8cc18..439e69ece9 100644 --- a/compiler/dex/verified_method.h +++ b/compiler/dex/verified_method.h @@ -39,9 +39,6 @@ class VerifiedMethod { // is better for performance (not just memory usage), especially for large sets. typedef std::vector<uint32_t> SafeCastSet; - // Devirtualization map type maps dex offset to field / method idx. - typedef SafeMap<uint32_t, DexFileReference> DequickenMap; - static const VerifiedMethod* Create(verifier::MethodVerifier* method_verifier) REQUIRES_SHARED(Locks::mutator_lock_); ~VerifiedMethod() = default; @@ -68,17 +65,10 @@ class VerifiedMethod { } private: - // Generate dequickening map into dequicken_map_. Returns false if there is an error. - bool GenerateDequickenMap(verifier::MethodVerifier* method_verifier) - REQUIRES_SHARED(Locks::mutator_lock_); - // Generate safe case set into safe_cast_set_. void GenerateSafeCastSet(verifier::MethodVerifier* method_verifier) REQUIRES_SHARED(Locks::mutator_lock_); - // Dequicken map is required for compiling quickened byte codes. The quicken maps from - // dex PC to dex method index or dex field index based on the instruction. - DequickenMap dequicken_map_; SafeCastSet safe_cast_set_; const uint32_t encountered_error_types_; |