summaryrefslogtreecommitdiffstats
path: root/runtime/java_vm_ext.cc
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-09-11 13:14:31 -0700
committerMathieu Chartier <mathieuc@google.com>2014-09-11 16:55:49 -0700
commit2e158932354e5950eb59c79498ab46b0586885fd (patch)
tree6cccc50847537d9dd807b49347b7bec846e5ec6e /runtime/java_vm_ext.cc
parent02308cf78484bcd125d92ebb27185d890889b92a (diff)
downloadandroid_art-2e158932354e5950eb59c79498ab46b0586885fd.tar.gz
android_art-2e158932354e5950eb59c79498ab46b0586885fd.tar.bz2
android_art-2e158932354e5950eb59c79498ab46b0586885fd.zip
Delete pin table
The pin table was brought over from dalvik but not really needed since ART doesn't support pinning in movable spaces. The only thing it did was hold objects live for JNI functions. This shouldn't be necessary since people keep jni references to these objects or else they could never release the elements. Bug: 17456946 (cherry picked from commit a967c62e4e6675d3553445aa8e95a09e7a3381b0) Change-Id: Ibed0d029157ffb9e75ecd80d4d544d690986c090
Diffstat (limited to 'runtime/java_vm_ext.cc')
-rw-r--r--runtime/java_vm_ext.cc27
1 files changed, 0 insertions, 27 deletions
diff --git a/runtime/java_vm_ext.cc b/runtime/java_vm_ext.cc
index 0ac5b88e80..1444d9762a 100644
--- a/runtime/java_vm_ext.cc
+++ b/runtime/java_vm_ext.cc
@@ -36,9 +36,6 @@
namespace art {
-static const size_t kPinTableInitial = 16; // Arbitrary.
-static const size_t kPinTableMax = 1024; // Arbitrary sanity check.
-
static size_t gGlobalsInitial = 512; // Arbitrary.
static size_t gGlobalsMax = 51200; // Arbitrary sanity check. (Must fit in 16 bits.)
@@ -365,8 +362,6 @@ JavaVMExt::JavaVMExt(Runtime* runtime, ParsedOptions* options)
force_copy_(options->force_copy_),
tracing_enabled_(!options->jni_trace_.empty() || VLOG_IS_ON(third_party_jni)),
trace_(options->jni_trace_),
- pins_lock_("JNI pin table lock", kPinTableLock),
- pin_table_("pin table", kPinTableInitial, kPinTableMax),
globals_lock_("JNI global reference table lock"),
globals_(gGlobalsInitial, gGlobalsMax, kGlobal),
libraries_(new Libraries),
@@ -523,10 +518,6 @@ void JavaVMExt::DumpForSigQuit(std::ostream& os) {
}
Thread* self = Thread::Current();
{
- MutexLock mu(self, pins_lock_);
- os << "; pins=" << pin_table_.Size();
- }
- {
ReaderMutexLock mu(self, globals_lock_);
os << "; globals=" << globals_.Capacity();
}
@@ -568,16 +559,6 @@ mirror::Object* JavaVMExt::DecodeWeakGlobal(Thread* self, IndirectRef ref) {
return weak_globals_.Get(ref);
}
-void JavaVMExt::PinPrimitiveArray(Thread* self, mirror::Array* array) {
- MutexLock mu(self, pins_lock_);
- pin_table_.Add(array);
-}
-
-void JavaVMExt::UnpinPrimitiveArray(Thread* self, mirror::Array* array) {
- MutexLock mu(self, pins_lock_);
- pin_table_.Remove(array);
-}
-
void JavaVMExt::DumpReferenceTables(std::ostream& os) {
Thread* self = Thread::Current();
{
@@ -588,10 +569,6 @@ void JavaVMExt::DumpReferenceTables(std::ostream& os) {
MutexLock mu(self, weak_globals_lock_);
weak_globals_.Dump(os);
}
- {
- MutexLock mu(self, pins_lock_);
- pin_table_.Dump(os);
- }
}
bool JavaVMExt::LoadNativeLibrary(JNIEnv* env, const std::string& path, jobject class_loader,
@@ -779,10 +756,6 @@ void JavaVMExt::VisitRoots(RootCallback* callback, void* arg) {
ReaderMutexLock mu(self, globals_lock_);
globals_.VisitRoots(callback, arg, 0, kRootJNIGlobal);
}
- {
- MutexLock mu(self, pins_lock_);
- pin_table_.VisitRoots(callback, arg, 0, kRootVMInternal);
- }
// The weak_globals table is visited by the GC itself (because it mutates the table).
}