Continue try allocating until we've reached max capacity.
004-StackWalk currently fails because we start with a too low code cache
to allocate code for a method the test expects to be JITted. To de-flake
the test, just keep on trying to allocate.
Test: test.py
Change-Id: Ie33e13bcc8825058259e12b0d4d552e89c9816e3
diff --git a/runtime/jit/jit_code_cache.h b/runtime/jit/jit_code_cache.h
index 50e1e2b..cefbf25 100644
--- a/runtime/jit/jit_code_cache.h
+++ b/runtime/jit/jit_code_cache.h
@@ -466,6 +466,9 @@
// Notify all waiting threads that a collection is done.
void NotifyCollectionDone(Thread* self) REQUIRES(Locks::jit_lock_);
+ // Return whether the code cache's capacity is at its maximum.
+ bool IsAtMaxCapacity() const REQUIRES(Locks::jit_lock_);
+
// Return whether we should do a full collection given the current state of the cache.
bool ShouldDoFullCollection()
REQUIRES(Locks::jit_lock_)