summaryrefslogtreecommitdiff
path: root/runtime/class_linker.h
diff options
context:
space:
mode:
author Alex Light <allight@google.com> 2019-11-13 09:33:52 -0800
committer Treehugger Robot <treehugger-gerrit@google.com> 2019-11-26 02:11:19 +0000
commitc47040d31cbcd8cddd5fadb552b4f0f6c94b5bd0 (patch)
tree50df569420cd6746daadf1487933719d1f86d66b /runtime/class_linker.h
parentdc540dfffb6863177143d024dd6f491775d77585 (diff)
Allow structural redefinition on non-final classes.
This adds support for structurally redefining non-final, non-finalizable classes. The only restriction is that one cannot redefine a class at the same time as any of its supertypes, if a structural redefinition is occurring. The structural redefinition may not remove any fields or methods, change the superclass or change the implemented interfaces. Adding new methods or fields, both static or non-static, public, private, protected, or package-private, is supported. Test: ./test.py --host Bug: 134162467 Bug: 144168550 Change-Id: I32e9e854b3e56270170b10e8f5aba9de8f6bfdfa
Diffstat (limited to 'runtime/class_linker.h')
-rw-r--r--runtime/class_linker.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/runtime/class_linker.h b/runtime/class_linker.h
index a1ba461270..dd3ef7a164 100644
--- a/runtime/class_linker.h
+++ b/runtime/class_linker.h
@@ -1440,6 +1440,10 @@ class ClassLoadCallback {
public:
virtual ~ClassLoadCallback() {}
+ // Called immediately before beginning class-definition and immediately before returning from it.
+ virtual void BeginDefineClass() REQUIRES_SHARED(Locks::mutator_lock_) {}
+ virtual void EndDefineClass() REQUIRES_SHARED(Locks::mutator_lock_) {}
+
// If set we will replace initial_class_def & initial_dex_file with the final versions. The
// callback author is responsible for ensuring these are allocated in such a way they can be
// cleaned up if another transformation occurs. Note that both must be set or null/unchanged on