ART: Allow unlimited PushLocalFrame

The local reference table is resizable. Allow arbitrary capacity
requests and only fail when the request cannot be satisfied.

Bug: 62223672
Test: m test-art-host
Change-Id: I05183098359c5a33473701e9a0d2a4d6c81bde58
diff --git a/runtime/jni_env_ext.cc b/runtime/jni_env_ext.cc
index 0148a1c..c1ecb3a 100644
--- a/runtime/jni_env_ext.cc
+++ b/runtime/jni_env_ext.cc
@@ -123,8 +123,8 @@
   monitors.Dump(os);
 }
 
-void JNIEnvExt::PushFrame(int capacity ATTRIBUTE_UNUSED) {
-  // TODO: take 'capacity' into account.
+void JNIEnvExt::PushFrame(int capacity) {
+  DCHECK_GE(locals.FreeCapacity(), static_cast<size_t>(capacity));
   stacked_local_ref_cookies.push_back(local_ref_cookie);
   local_ref_cookie = locals.GetSegmentState();
 }