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/compiler.cc b/src/compiler.cc
index abbb939..e8bc390 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -498,7 +498,7 @@
}
}
-void Compiler::CompileOne(const Method* method) {
+void Compiler::CompileOne(const AbstractMethod* method) {
DCHECK(!Runtime::Current()->IsStarted());
Thread* self = Thread::Current();
jobject class_loader;
@@ -682,7 +682,7 @@
class_loader, false);
}
-static Method* ComputeMethodReferencedFromCompilingMethod(ScopedObjectAccess& soa,
+static AbstractMethod* ComputeMethodReferencedFromCompilingMethod(ScopedObjectAccess& soa,
OatCompilationUnit* mUnit,
uint32_t method_idx,
InvokeType type)
@@ -822,7 +822,7 @@
return false; // Incomplete knowledge needs slow path.
}
-void Compiler::GetCodeAndMethodForDirectCall(InvokeType type, InvokeType sharp_type, Method* method,
+void Compiler::GetCodeAndMethodForDirectCall(InvokeType type, InvokeType sharp_type, AbstractMethod* method,
uintptr_t& direct_code, uintptr_t& direct_method) {
direct_code = 0;
direct_method = 0;
@@ -866,7 +866,7 @@
vtable_idx = -1;
direct_code = 0;
direct_method = 0;
- Method* resolved_method =
+ AbstractMethod* resolved_method =
ComputeMethodReferencedFromCompilingMethod(soa, mUnit, method_idx, type);
if (resolved_method != NULL) {
// Don't try to fast-path if we don't understand the caller's class or this appears to be an
@@ -1156,7 +1156,7 @@
it.Next();
}
while (it.HasNextDirectMethod()) {
- Method* method = class_linker->ResolveMethod(dex_file, it.GetMemberIndex(), dex_cache,
+ AbstractMethod* method = class_linker->ResolveMethod(dex_file, it.GetMemberIndex(), dex_cache,
class_loader, NULL, it.GetMethodInvokeType(class_def));
if (method == NULL) {
CHECK(self->IsExceptionPending());
@@ -1165,7 +1165,7 @@
it.Next();
}
while (it.HasNextVirtualMethod()) {
- Method* method = class_linker->ResolveMethod(dex_file, it.GetMemberIndex(), dex_cache,
+ AbstractMethod* method = class_linker->ResolveMethod(dex_file, it.GetMemberIndex(), dex_cache,
class_loader, NULL, it.GetMethodInvokeType(class_def));
if (method == NULL) {
CHECK(self->IsExceptionPending());