From b6f4c79b06bb97651a7be1ac828d18ed18356603 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Mon, 4 May 2020 15:37:29 +0100 Subject: Clean up Constructor/Method/Field construction. Simplify the code by ignoring active transactions. Writing to fields of a newly allocated object does not need to be recorded as aborting the transaction removes all references to the new object and it's unnecessary to roll back writes to unreachable object's fields. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: aosp_taimen-userdebug boots. Change-Id: Ib5cd60c003d2ad3e6a246ff86d6b9288428c60ee --- runtime/native/java_lang_Class.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'runtime/native/java_lang_Class.cc') diff --git a/runtime/native/java_lang_Class.cc b/runtime/native/java_lang_Class.cc index 2c537c6626..5a73bf3383 100644 --- a/runtime/native/java_lang_Class.cc +++ b/runtime/native/java_lang_Class.cc @@ -540,10 +540,10 @@ static jobject Class_getDeclaredConstructorInternal( return nullptr; } Handle result = hs.NewHandle( - mirror::Class::GetDeclaredConstructorInternal( - soa.Self(), - klass, - soa.Decode>(args))); + mirror::Class::GetDeclaredConstructorInternal( + soa.Self(), + klass, + soa.Decode>(args))); if (result == nullptr || ShouldDenyAccessToMember(result->GetArtMethod(), soa.Self())) { return nullptr; } @@ -588,7 +588,7 @@ static jobjectArray Class_getDeclaredConstructorsInternal( DCHECK_EQ(Runtime::Current()->GetClassLinker()->GetImagePointerSize(), kRuntimePointerSize); DCHECK(!Runtime::Current()->IsActiveTransaction()); ObjPtr constructor = - mirror::Constructor::CreateFromArtMethod(soa.Self(), &m); + mirror::Constructor::CreateFromArtMethod(soa.Self(), &m); if (UNLIKELY(constructor == nullptr)) { soa.Self()->AssertPendingOOMException(); return nullptr; @@ -611,7 +611,7 @@ static jobject Class_getDeclaredMethodInternal(JNIEnv* env, jobject javaThis, return nullptr; } Handle result = hs.NewHandle( - mirror::Class::GetDeclaredMethodInternal( + mirror::Class::GetDeclaredMethodInternal( soa.Self(), klass, soa.Decode(name), @@ -659,7 +659,7 @@ static jobjectArray Class_getDeclaredMethodsUnchecked(JNIEnv* env, jobject javaT DCHECK_EQ(Runtime::Current()->GetClassLinker()->GetImagePointerSize(), kRuntimePointerSize); DCHECK(!Runtime::Current()->IsActiveTransaction()); ObjPtr method = - mirror::Method::CreateFromArtMethod(soa.Self(), &m); + mirror::Method::CreateFromArtMethod(soa.Self(), &m); if (method == nullptr) { soa.Self()->AssertPendingException(); return nullptr; -- cgit v1.2.3-59-g8ed1b