From a7e38d8aaacfca85b40b5df654f85c0979968672 Mon Sep 17 00:00:00 2001 From: Alex Light Date: Thu, 19 Jan 2017 14:57:28 -0800 Subject: Use original dex file for retransformation. The spec requires us to pass the dex file as it appeared before any retransformation-capable agents had modified it to the ClassFileLoadHooks when RetransformClasses is called. We do this by saving the initial dex file bytes into the class as a byte[]. Bug: 32369916 Test: mma -j40 test-art-host Change-Id: Ic6af3738cd2a831e91ba1144f502fa58b3c333e4 --- runtime/mirror/class_ext.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'runtime/mirror/class_ext.h') diff --git a/runtime/mirror/class_ext.h b/runtime/mirror/class_ext.h index 91046314db..ad8a61b676 100644 --- a/runtime/mirror/class_ext.h +++ b/runtime/mirror/class_ext.h @@ -61,6 +61,12 @@ class MANAGED ClassExt : public Object { return GetFieldObject(OFFSET_OF_OBJECT_MEMBER(ClassExt, obsolete_methods_)); } + ByteArray* GetOriginalDexFileBytes() REQUIRES_SHARED(Locks::mutator_lock_) { + return GetFieldObject(OFFSET_OF_OBJECT_MEMBER(ClassExt, original_dex_file_bytes_)); + } + + void SetOriginalDexFileBytes(ObjPtr bytes) REQUIRES_SHARED(Locks::mutator_lock_); + void SetObsoleteArrays(ObjPtr methods, ObjPtr> dex_caches) REQUIRES_SHARED(Locks::mutator_lock_); @@ -80,7 +86,7 @@ class MANAGED ClassExt : public Object { HeapReference obsolete_methods_; - HeapReference original_dex_cache_; + HeapReference original_dex_file_bytes_; // The saved verification error of this class. HeapReference verify_error_; -- cgit v1.2.3-59-g8ed1b