Disable inlining in Optimizing when --debuggable is set.
Change-Id: I6365269e606e0c176e518c06719ebdaf6a4c4b88
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index e22f7cc..bd9267c 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -38,6 +38,11 @@
static constexpr int kDepthLimit = 5;
void HInliner::Run() {
+ if (graph_->IsDebuggable()) {
+ // For simplicity, we currently never inline when the graph is debuggable. This avoids
+ // doing some logic in the runtime to discover if a method could have been inlined.
+ return;
+ }
const GrowableArray<HBasicBlock*>& blocks = graph_->GetReversePostOrder();
for (size_t i = 0; i < blocks.Size(); ++i) {
HBasicBlock* block = blocks.Get(i);
diff --git a/test/Android.run-test.mk b/test/Android.run-test.mk
index c666d35..cf15a7a 100644
--- a/test/Android.run-test.mk
+++ b/test/Android.run-test.mk
@@ -377,6 +377,20 @@
TEST_ART_BROKEN_OPTIMIZING_NONDEBUGGABLE_RUN_TESTS :=
+# Tests that should fail when the optimizing compiler compiles them debuggable.
+TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS := \
+ 441-checker-inliner \
+ 446-checker-inliner2 \
+ 447-checker-inliner3 \
+
+ifneq (,$(filter optimizing,$(COMPILER_TYPES)))
+ ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
+ optimizing,$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
+ $(IMAGE_TYPES),$(PICTEST_TYPES),debuggable,$(TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS),$(ALL_ADDRESS_SIZES))
+endif
+
+TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS :=
+
# Clear variables ahead of appending to them when defining tests.
$(foreach target, $(TARGET_TYPES), $(eval ART_RUN_TEST_$(call name-to-var,$(target))_RULES :=))