diff --git a/opt/interdex/InterDex.cpp b/opt/interdex/InterDex.cpp index a741eabe853..2e8999b1baf 100644 --- a/opt/interdex/InterDex.cpp +++ b/opt/interdex/InterDex.cpp @@ -76,8 +76,7 @@ std::unordered_set find_unrefenced_coldstart_classes( }, [&](DexMethod* meth, const IRCode& code) { auto base_cls = meth->get_class(); - always_assert(meth->get_code()->editable_cfg_built()); - for (auto& mie : cfg::InstructionIterable(meth->get_code()->cfg())) { + for (auto& mie : InstructionIterable(meth->get_code())) { auto inst = mie.insn; DexType* called_cls = nullptr; if (inst->has_method()) { @@ -1185,12 +1184,6 @@ DexClass* InterDex::get_canary_cls(EmittingState& emitting_state, std::lock_guard lock_guard(canary_mutex); canary_cls = create_canary(dexnum); set_clinit_methods_if_needed(canary_cls); - for (auto* m : canary_cls->get_all_methods()) { - if (m->get_code() == nullptr) { - continue; - } - m->get_code()->build_cfg(); - } } MethodRefs clazz_mrefs; FieldRefs clazz_frefs; @@ -1286,14 +1279,6 @@ void InterDex::post_process_dex(EmittingState& emitting_state, TRACE(IDEX, 4, "IDEX: Emitting %s-plugin-generated class :: %s", plugin->name().c_str(), SHOW(cls)); classes.push_back(cls); - // For the plugin cls, make sure all methods are editable cfg built. - for (auto* m : cls->get_all_methods()) { - if (m->get_code() == nullptr) { - continue; - } - m->get_code()->build_cfg(); - } - // If this is the primary dex, or if there are any betamap-ordered // classes in this dex, then we treat the additional classes as // perf-sensitive, to be conservative. diff --git a/opt/interdex/InterDexPass.cpp b/opt/interdex/InterDexPass.cpp index b5fa93ed564..bfa73c9304d 100644 --- a/opt/interdex/InterDexPass.cpp +++ b/opt/interdex/InterDexPass.cpp @@ -13,7 +13,6 @@ #include "PassManager.h" #include "Show.h" #include "StlUtil.h" -#include "Walkers.h" #include "WorkQueue.h" namespace { diff --git a/opt/interdex/InterDexPass.h b/opt/interdex/InterDexPass.h index a49c8ee907d..f6c8746bd58 100644 --- a/opt/interdex/InterDexPass.h +++ b/opt/interdex/InterDexPass.h @@ -84,6 +84,8 @@ class InterDexPass : public Pass { ++m_eval; } + bool is_cfg_legacy() override { return true; } + void run_pass(DexStoresVector&, ConfigFiles&, PassManager&) override; bool minimize_cross_dex_refs() const { return m_minimize_cross_dex_refs; } diff --git a/opt/interdex/InterDexReshufflePass.h b/opt/interdex/InterDexReshufflePass.h index 126155b6e06..2fe5d11aa09 100644 --- a/opt/interdex/InterDexReshufflePass.h +++ b/opt/interdex/InterDexReshufflePass.h @@ -68,6 +68,8 @@ class InterDexReshufflePass : public Pass { }; } + bool is_cfg_legacy() override { return true; } + void run_pass(DexStoresVector&, ConfigFiles&, PassManager&) override; void bind_config() override { diff --git a/opt/interdex/SortRemainingClassesPass.h b/opt/interdex/SortRemainingClassesPass.h index 5f9b9f0ddfa..401801d9021 100644 --- a/opt/interdex/SortRemainingClassesPass.h +++ b/opt/interdex/SortRemainingClassesPass.h @@ -31,6 +31,8 @@ class SortRemainingClassesPass : public Pass { "Whether to sort classes in primary dex."); } + bool is_cfg_legacy() override { return true; } + void run_pass(DexStoresVector&, ConfigFiles&, PassManager&) override; private: