summaryrefslogtreecommitdiff
path: root/runtime/class_table.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2016-11-23 13:35:26 +0000
committer Vladimir Marko <vmarko@google.com> 2016-11-23 17:01:16 +0000
commit25dcbad4462ea7279ee2bbe0884abc25bdfac77a (patch)
treef8f8db090bf6735ead2c6999b7b574f4b7278056 /runtime/class_table.h
parentdd77c2b4ff36db082edfbcf2631c78a9282689e1 (diff)
Revert "Revert "Make sure that const-class linkage is preserved.""
Fix jdwp getting multiple instances of the same class. Fix counting "zygote"/"non-zygote" classes in class table. Fix FindClass() to EnsureResolved() classes added by a racing thread to the class table. Test: m test-art-host Test: art/tools/run-jdwp-tests.sh --mode=host --variant=X64 --debug Bug: 30627598 This reverts commit ecffc67068a28d55d131553bf915fdb9fafbbc03. Change-Id: I15807949da4f163c2693fac2fbfc274f17685f8a
Diffstat (limited to 'runtime/class_table.h')
-rw-r--r--runtime/class_table.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/runtime/class_table.h b/runtime/class_table.h
index 558c144013..92634a434a 100644
--- a/runtime/class_table.h
+++ b/runtime/class_table.h
@@ -84,10 +84,14 @@ class ClassTable {
REQUIRES_SHARED(Locks::mutator_lock_);
// Returns the number of classes in previous snapshots.
- size_t NumZygoteClasses() const REQUIRES(!lock_);
+ size_t NumZygoteClasses(ObjPtr<mirror::ClassLoader> defining_loader) const
+ REQUIRES(!lock_)
+ REQUIRES_SHARED(Locks::mutator_lock_);
// Returns all off the classes in the lastest snapshot.
- size_t NumNonZygoteClasses() const REQUIRES(!lock_);
+ size_t NumNonZygoteClasses(ObjPtr<mirror::ClassLoader> defining_loader) const
+ REQUIRES(!lock_)
+ REQUIRES_SHARED(Locks::mutator_lock_);
// Update a class in the table with the new class. Returns the existing class which was replaced.
mirror::Class* UpdateClass(const char* descriptor, mirror::Class* new_klass, size_t hash)
@@ -173,6 +177,11 @@ class ClassTable {
private:
void InsertWithoutLocks(ObjPtr<mirror::Class> klass) NO_THREAD_SAFETY_ANALYSIS;
+ size_t CountDefiningLoaderClasses(ObjPtr<mirror::ClassLoader> defining_loader,
+ const ClassSet& set) const
+ REQUIRES(lock_)
+ REQUIRES_SHARED(Locks::mutator_lock_);
+
// Return true if we inserted the oat file, false if it already exists.
bool InsertOatFileLocked(const OatFile* oat_file)
REQUIRES(lock_)