summaryrefslogtreecommitdiff
path: root/openjdkjvmti/ti_extension.cc
diff options
context:
space:
mode:
author Alex Light <allight@google.com> 2019-11-26 18:52:06 +0000
committer Treehugger Robot <treehugger-gerrit@google.com> 2019-12-02 18:34:20 +0000
commitf1b809ce611e943f926fff97cefe0930226ffcc2 (patch)
treef75675383cf8018f9f333e608df35edbacf1c913 /openjdkjvmti/ti_extension.cc
parent20b7a9b8aeaf76fc8f3248f211489fd00af73170 (diff)
Revert^2 "Allow structural redefinition on non-final classes."
We were incorrectly racing with the rest of the runtime in a couple of places. First we would return an ObjPtr of a newly defined class after holding it over a suspend point. This could lead to DefineClass returning an obsolete class in some cases. We also failed to ensure the class-status was synchronized between the old and new classes during structural redefinition. This could lead to a class appearing to go backwards in status. This reverts commit 88b1c83080afcb2bfb6f781ded1c90fe8f9eab4d. Reason for revert: Fixed issues causing test failures. Test: ./test.py --host Bug: 134162467 Bug: 144168550 Change-Id: I4d0f7718490532f0ef14a9561b8e7000ef292b12
Diffstat (limited to 'openjdkjvmti/ti_extension.cc')
-rw-r--r--openjdkjvmti/ti_extension.cc42
1 files changed, 22 insertions, 20 deletions
diff --git a/openjdkjvmti/ti_extension.cc b/openjdkjvmti/ti_extension.cc
index 058a188630..130169711f 100644
--- a/openjdkjvmti/ti_extension.cc
+++ b/openjdkjvmti/ti_extension.cc
@@ -423,29 +423,31 @@ jvmtiError ExtensionUtil::GetExtensionFunctions(jvmtiEnv* env,
reinterpret_cast<jvmtiExtensionFunction>(Redefiner::StructurallyRedefineClasses),
"com.android.art.class.structurally_redefine_classes",
"Entrypoint for structural class redefinition. Has the same signature as RedefineClasses."
- " Currently this only supports adding new static fields to a class without any instance"
- " fields or methods. After calling this com.android.art.structural_dex_file_load_hook"
- " events will be triggered, followed by re-transformable ClassFileLoadHook events. After"
- " this method completes subsequent RetransformClasses calls will use the input to this"
- " function as the initial class definition.",
+ " Currently does not support redefining a class and any of its supertypes at the same time."
+ " Only supports additive changes, methods and fields may not be removed. Supertypes and"
+ " implemented interfaces may not be changed. After calling this"
+ " com.android.art.structural_dex_file_load_hook events will be triggered, followed by"
+ " re-transformable ClassFileLoadHook events. After this method completes subsequent"
+ " RetransformClasses calls will use the input to this function as the initial class"
+ " definition.",
{
- { "num_classes", JVMTI_KIND_IN, JVMTI_TYPE_JINT, false },
- { "class_definitions", JVMTI_KIND_IN_BUF, JVMTI_TYPE_CVOID, false },
+ { "num_classes", JVMTI_KIND_IN, JVMTI_TYPE_JINT, false },
+ { "class_definitions", JVMTI_KIND_IN_BUF, JVMTI_TYPE_CVOID, false },
},
{
- ERR(CLASS_LOADER_UNSUPPORTED),
- ERR(FAILS_VERIFICATION),
- ERR(ILLEGAL_ARGUMENT),
- ERR(INVALID_CLASS),
- ERR(MUST_POSSESS_CAPABILITY),
- ERR(MUST_POSSESS_CAPABILITY),
- ERR(NULL_POINTER),
- ERR(OUT_OF_MEMORY),
- ERR(UNMODIFIABLE_CLASS),
- ERR(UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED),
- ERR(UNSUPPORTED_REDEFINITION_METHOD_ADDED),
- ERR(UNSUPPORTED_REDEFINITION_METHOD_DELETED),
- ERR(UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED),
+ ERR(CLASS_LOADER_UNSUPPORTED),
+ ERR(FAILS_VERIFICATION),
+ ERR(ILLEGAL_ARGUMENT),
+ ERR(INVALID_CLASS),
+ ERR(MUST_POSSESS_CAPABILITY),
+ ERR(MUST_POSSESS_CAPABILITY),
+ ERR(NULL_POINTER),
+ ERR(OUT_OF_MEMORY),
+ ERR(UNMODIFIABLE_CLASS),
+ ERR(UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED),
+ ERR(UNSUPPORTED_REDEFINITION_METHOD_ADDED),
+ ERR(UNSUPPORTED_REDEFINITION_METHOD_DELETED),
+ ERR(UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED),
});
if (error != ERR(NONE)) {
return error;