Disable -Xjnigreflimit: in art too.
Bug: 7903975
Change-Id: I1ec552b35331227ecd7dc3d0a2f0507b1c24e375
diff --git a/src/jni_internal.cc b/src/jni_internal.cc
index e457edc..50b28b8 100644
--- a/src/jni_internal.cc
+++ b/src/jni_internal.cc
@@ -62,17 +62,10 @@
static const size_t kPinTableMax = 1024; // Arbitrary sanity check.
static size_t gGlobalsInitial = 512; // Arbitrary.
-static size_t gGlobalsMax = 51200; // Arbitrary sanity check.
+static size_t gGlobalsMax = 51200; // Arbitrary sanity check. (Must fit in 16 bits.)
static const size_t kWeakGlobalsInitial = 16; // Arbitrary.
-static const size_t kWeakGlobalsMax = 51200; // Arbitrary sanity check.
-
-void SetJniGlobalsMax(size_t max) {
- if (max != 0) {
- gGlobalsMax = max;
- gGlobalsInitial = std::min(gGlobalsInitial, gGlobalsMax);
- }
-}
+static const size_t kWeakGlobalsMax = 51200; // Arbitrary sanity check. (Must fit in 16 bits.)
static jweak AddWeakGlobalReference(ScopedObjectAccess& soa, Object* obj)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
diff --git a/src/jni_internal.h b/src/jni_internal.h
index dc6ca4a..7b43f95 100644
--- a/src/jni_internal.h
+++ b/src/jni_internal.h
@@ -48,7 +48,6 @@
class ScopedObjectAccess;
class Thread;
-void SetJniGlobalsMax(size_t max);
void JniAbortF(const char* jni_function_name, const char* fmt, ...)
__attribute__((__format__(__printf__, 2, 3)));
void RegisterNativeMethods(JNIEnv* env, const char* jni_class_name, const JNINativeMethod* methods,
diff --git a/src/runtime.cc b/src/runtime.cc
index 3a528a1..e5fb46f 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -345,7 +345,6 @@
parsed->interpreter_only_ = false;
parsed->is_concurrent_gc_enabled_ = true;
- parsed->jni_globals_max_ = 0;
parsed->lock_profiling_threshold_ = 0;
parsed->hook_is_sensitive_thread_ = NULL;
@@ -535,7 +534,7 @@
}
}
} else if (StartsWith(option, "-Xjnigreflimit:")) {
- parsed->jni_globals_max_ = ParseIntegerOrDie(option);
+ // Silently ignored for backwards compatibility.
} else if (StartsWith(option, "-Xlockprofthreshold:")) {
parsed->lock_profiling_threshold_ = ParseIntegerOrDie(option);
} else if (StartsWith(option, "-Xstacktracefile:")) {
@@ -791,7 +790,6 @@
QuasiAtomic::Startup();
- SetJniGlobalsMax(options->jni_globals_max_);
Monitor::Init(options->lock_profiling_threshold_, options->hook_is_sensitive_thread_);
host_prefix_ = options->host_prefix_;
diff --git a/src/runtime.h b/src/runtime.h
index 0b893a3..31b3a1b 100644
--- a/src/runtime.h
+++ b/src/runtime.h
@@ -63,7 +63,7 @@
public:
typedef std::vector<std::pair<std::string, const void*> > Options;
- // In small mode, apps with fewer than this number of methods will be compiled
+ // In small mode, apps with fewer than this number of methods will be compiled
// anyways.
// TODO: come up with a reasonable default.
static const size_t kDefaultSmallModeMethodThreshold = 0;
@@ -96,7 +96,6 @@
size_t heap_max_free_;
double heap_target_utilization_;
size_t stack_size_;
- size_t jni_globals_max_;
size_t lock_profiling_threshold_;
std::string stack_trace_file_;
bool method_trace_;