summaryrefslogtreecommitdiff
path: root/compiler/dex/mir_graph.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/dex/mir_graph.cc')
-rw-r--r--compiler/dex/mir_graph.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/dex/mir_graph.cc b/compiler/dex/mir_graph.cc
index 9f985890b1..08ca1b288c 100644
--- a/compiler/dex/mir_graph.cc
+++ b/compiler/dex/mir_graph.cc
@@ -2559,4 +2559,13 @@ const uint16_t* MIRGraph::GetInsns(int m_unit_index) const {
return m_units_[m_unit_index]->GetCodeItem()->insns_;
}
+void MIRGraph::SetPuntToInterpreter(bool val) {
+ punt_to_interpreter_ = val;
+ if (val) {
+ // Disable all subsequent optimizations. They may not be safe to run. (For example,
+ // LVN/GVN assumes there are no conflicts found by the type inference pass.)
+ cu_->disable_opt = ~static_cast<decltype(cu_->disable_opt)>(0);
+ }
+}
+
} // namespace art