Remember whether a method was worth inlining.
Change-Id: I9d8efe312b264739ac6307f966e43c1d7650a3ca
diff --git a/runtime/mirror/art_method.h b/runtime/mirror/art_method.h
index d878f25..aaa9b56 100644
--- a/runtime/mirror/art_method.h
+++ b/runtime/mirror/art_method.h
@@ -125,6 +125,14 @@
return (GetAccessFlags() & kAccNative) != 0;
}
+ bool ShouldNotInline() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+ return (GetAccessFlags() & kAccDontInline) != 0;
+ }
+
+ void SetShouldNotInline() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+ SetAccessFlags(GetAccessFlags() | kAccDontInline);
+ }
+
bool IsFastNative() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
uint32_t mask = kAccFastNative | kAccNative;
return (GetAccessFlags() & mask) == mask;
diff --git a/runtime/modifiers.h b/runtime/modifiers.h
index 09dc78a..e7bd207 100644
--- a/runtime/modifiers.h
+++ b/runtime/modifiers.h
@@ -48,6 +48,10 @@
static constexpr uint32_t kAccFastNative = 0x00080000; // method (dex only)
static constexpr uint32_t kAccMiranda = 0x00200000; // method (dex only)
+// Flag is set if the compiler decides it is not worth trying
+// to inline the method. This avoids other callers to try it again and again.
+static constexpr uint32_t kAccDontInline = 0x00400000; // method (dex only)
+
// Special runtime-only flags.
// Note: if only kAccClassIsReference is set, we have a soft reference.