diff options
author | Ian Rogers <irogers@google.com> | 2013-08-14 02:15:57 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-08-14 02:15:58 +0000 |
commit | 1d1e267136732c2b123470b05c06fa536fa6dbbb (patch) | |
tree | a2c4cf3b5ffa7199d38db677886926c0b9a813cf /runtime/runtime.cc | |
parent | a804b711f21db74f9fb0dd7a5854656b1252fb97 (diff) | |
parent | ea46f950e7a51585db293cd7f047de190a482414 (diff) | |
download | art-1d1e267136732c2b123470b05c06fa536fa6dbbb.zip art-1d1e267136732c2b123470b05c06fa536fa6dbbb.tar.gz art-1d1e267136732c2b123470b05c06fa536fa6dbbb.tar.bz2 |
Merge "Refactor java.lang.reflect implementation" into dalvik-dev
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r-- | runtime/runtime.cc | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc index 7c354b5..a30403d 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -42,12 +42,11 @@ #include "intern_table.h" #include "invoke_arg_array_builder.h" #include "jni_internal.h" -#include "mirror/abstract_method-inl.h" +#include "mirror/art_field-inl.h" +#include "mirror/art_method-inl.h" #include "mirror/array.h" #include "mirror/class-inl.h" #include "mirror/class_loader.h" -#include "mirror/field.h" -#include "mirror/field-inl.h" #include "mirror/throwable.h" #include "monitor.h" #include "oat_file.h" @@ -657,7 +656,7 @@ static void CreateSystemClassLoader() { soa.Decode<mirror::Class*>(WellKnownClasses::java_lang_ClassLoader); CHECK(Runtime::Current()->GetClassLinker()->EnsureInitialized(class_loader_class, true, true)); - mirror::AbstractMethod* getSystemClassLoader = + mirror::ArtMethod* getSystemClassLoader = class_loader_class->FindDirectMethod("getSystemClassLoader", "()Ljava/lang/ClassLoader;"); CHECK(getSystemClassLoader != NULL); @@ -672,8 +671,8 @@ static void CreateSystemClassLoader() { mirror::Class* thread_class = soa.Decode<mirror::Class*>(WellKnownClasses::java_lang_Thread); CHECK(Runtime::Current()->GetClassLinker()->EnsureInitialized(thread_class, true, true)); - mirror::Field* contextClassLoader = thread_class->FindDeclaredInstanceField("contextClassLoader", - "Ljava/lang/ClassLoader;"); + mirror::ArtField* contextClassLoader = thread_class->FindDeclaredInstanceField("contextClassLoader", + "Ljava/lang/ClassLoader;"); CHECK(contextClassLoader != NULL); contextClassLoader->SetObject(soa.Self()->GetPeer(), class_loader); @@ -1128,11 +1127,11 @@ void Runtime::VisitRoots(RootVisitor* visitor, void* arg, bool only_dirty, bool VisitNonConcurrentRoots(visitor, arg); } -mirror::AbstractMethod* Runtime::CreateResolutionMethod() { - mirror::Class* method_class = mirror::AbstractMethod::GetMethodClass(); +mirror::ArtMethod* Runtime::CreateResolutionMethod() { + mirror::Class* method_class = mirror::ArtMethod::GetJavaLangReflectArtMethod(); Thread* self = Thread::Current(); - SirtRef<mirror::AbstractMethod> - method(self, down_cast<mirror::AbstractMethod*>(method_class->AllocObject(self))); + SirtRef<mirror::ArtMethod> + method(self, down_cast<mirror::ArtMethod*>(method_class->AllocObject(self))); method->SetDeclaringClass(method_class); // TODO: use a special method for resolution method saves method->SetDexMethodIndex(DexFile::kDexNoIndex16); @@ -1143,12 +1142,12 @@ mirror::AbstractMethod* Runtime::CreateResolutionMethod() { return method.get(); } -mirror::AbstractMethod* Runtime::CreateCalleeSaveMethod(InstructionSet instruction_set, +mirror::ArtMethod* Runtime::CreateCalleeSaveMethod(InstructionSet instruction_set, CalleeSaveType type) { - mirror::Class* method_class = mirror::AbstractMethod::GetMethodClass(); + mirror::Class* method_class = mirror::ArtMethod::GetJavaLangReflectArtMethod(); Thread* self = Thread::Current(); - SirtRef<mirror::AbstractMethod> - method(self, down_cast<mirror::AbstractMethod*>(method_class->AllocObject(self))); + SirtRef<mirror::ArtMethod> + method(self, down_cast<mirror::ArtMethod*>(method_class->AllocObject(self))); method->SetDeclaringClass(method_class); // TODO: use a special method for callee saves method->SetDexMethodIndex(DexFile::kDexNoIndex16); @@ -1208,7 +1207,7 @@ mirror::AbstractMethod* Runtime::CreateCalleeSaveMethod(InstructionSet instructi return method.get(); } -void Runtime::SetCalleeSaveMethod(mirror::AbstractMethod* method, CalleeSaveType type) { +void Runtime::SetCalleeSaveMethod(mirror::ArtMethod* method, CalleeSaveType type) { DCHECK_LT(static_cast<int>(type), static_cast<int>(kLastCalleeSaveType)); callee_save_methods_[type] = method; } |