Change dex cache to be java object instead of array, add pointer to dex file in dex cache.
Generic clean up to facilitate having GDB macros for Pretty* helper functions.
Improved cleanliness of DexCache since having it as an object array was not the best solution.
Fixed a bug in InOrderWalk caused by ResolveType sometimes allocating classes.
Rename C++ Method to AbstractMethod and add two new classes Constructor, Method which both inherit from AbstractMethod.
Rename done to have the C++ code be closer to the java code.
Change-Id: I4995b4c5e47a3822192b08afa24a639d3b1f4da9
diff --git a/src/runtime.cc b/src/runtime.cc
index f37788d..8262f8a 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -556,7 +556,7 @@
Class* class_loader_class = soa.Decode<Class*>(WellKnownClasses::java_lang_ClassLoader);
CHECK(Runtime::Current()->GetClassLinker()->EnsureInitialized(class_loader_class, true, true));
- Method* getSystemClassLoader = class_loader_class->FindDirectMethod("getSystemClassLoader", "()Ljava/lang/ClassLoader;");
+ AbstractMethod* getSystemClassLoader = class_loader_class->FindDirectMethod("getSystemClassLoader", "()Ljava/lang/ClassLoader;");
CHECK(getSystemClassLoader != NULL);
ClassLoader* class_loader =
@@ -960,9 +960,9 @@
resolution_stub_array_[type] = resolution_stub_array;
}
-Method* Runtime::CreateResolutionMethod() {
- Class* method_class = Method::GetMethodClass();
- SirtRef<Method> method(down_cast<Method*>(method_class->AllocObject()));
+AbstractMethod* Runtime::CreateResolutionMethod() {
+ Class* method_class = AbstractMethod::GetMethodClass();
+ SirtRef<AbstractMethod> method(down_cast<AbstractMethod*>(method_class->AllocObject()));
method->SetDeclaringClass(method_class);
// TODO: use a special method for resolution method saves
method->SetDexMethodIndex(DexFile::kDexNoIndex16);
@@ -972,9 +972,9 @@
return method.get();
}
-Method* Runtime::CreateCalleeSaveMethod(InstructionSet instruction_set, CalleeSaveType type) {
- Class* method_class = Method::GetMethodClass();
- SirtRef<Method> method(down_cast<Method*>(method_class->AllocObject()));
+AbstractMethod* Runtime::CreateCalleeSaveMethod(InstructionSet instruction_set, CalleeSaveType type) {
+ Class* method_class = AbstractMethod::GetMethodClass();
+ SirtRef<AbstractMethod> method(down_cast<AbstractMethod*>(method_class->AllocObject()));
method->SetDeclaringClass(method_class);
// TODO: use a special method for callee saves
method->SetDexMethodIndex(DexFile::kDexNoIndex16);
@@ -1046,7 +1046,7 @@
return method.get();
}
-void Runtime::SetCalleeSaveMethod(Method* method, CalleeSaveType type) {
+void Runtime::SetCalleeSaveMethod(AbstractMethod* method, CalleeSaveType type) {
DCHECK_LT(static_cast<int>(type), static_cast<int>(kLastCalleeSaveType));
callee_save_methods_[type] = method;
}