Support for resolving unknown direct/static methods.
If we can't resolve a method we don't know whether it is direct or
static from the dex information (other than the invocation instruction).
Add support for a third type of resolution stub that can discover the
type of the method based on the calling method and PC of the invocation
instruction. Its still unimplemented to look up the instruction and
figure out if the type is static or not.
Change-Id: I8b76e6ba2c946376e7fe287dbcca17bcaab0e133
diff --git a/src/runtime.h b/src/runtime.h
index f99d994..8c4ce7c 100644
--- a/src/runtime.h
+++ b/src/runtime.h
@@ -156,9 +156,16 @@
ByteArray* GetAbstractMethodErrorStubArray() const;
void SetAbstractMethodErrorStubArray(ByteArray* abstract_method_error_stub_array);
- bool HasResolutionStubArray(bool is_static) const;
- ByteArray* GetResolutionStubArray(bool is_static) const;
- void SetResolutionStubArray(ByteArray* resolution_stub_array, bool is_static);
+ enum TrampolineType {
+ kInstanceMethod,
+ kStaticMethod,
+ kUnknownMethod,
+ kMaxTrampolineMethodType = kUnknownMethod
+ };
+ static TrampolineType GetTrampolineType(Method* method);
+ bool HasResolutionStubArray(TrampolineType type) const;
+ ByteArray* GetResolutionStubArray(TrampolineType type) const;
+ void SetResolutionStubArray(ByteArray* resolution_stub_array, TrampolineType type);
// Returns a special method that describes all callee saves being spilled to the stack.
Method* CreateCalleeSaveMethod(InstructionSet insns);
@@ -225,7 +232,7 @@
ByteArray* abstract_method_error_stub_array_;
- ByteArray* resolution_stub_array_[2];
+ ByteArray* resolution_stub_array_[kMaxTrampolineMethodType];
Method* callee_save_method_;