summaryrefslogtreecommitdiffstats
path: root/src/dex_cache.h
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2011-10-04 19:13:33 -0700
committerIan Rogers <irogers@google.com>2011-10-05 22:40:00 -0700
commitad25ac568407ceb14334e8551dd1c4dd0fd6993c (patch)
treef1e2edb4b87d0b5ce35f94069db2f6cdb77db210 /src/dex_cache.h
parent8c2f6414e1cff9a024a14369352f7ce112528b9e (diff)
downloadart-ad25ac568407ceb14334e8551dd1c4dd0fd6993c.zip
art-ad25ac568407ceb14334e8551dd1c4dd0fd6993c.tar.gz
art-ad25ac568407ceb14334e8551dd1c4dd0fd6993c.tar.bz2
Static and direct resolution stub.
Ensure that invoke static and direct go through a stub that causes resolution and initialization. Change-Id: I872900560322817d8f4378b04ac410d9ea0b3b17
Diffstat (limited to 'src/dex_cache.h')
-rw-r--r--src/dex_cache.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/dex_cache.h b/src/dex_cache.h
index a75d6f4..7ca6825 100644
--- a/src/dex_cache.h
+++ b/src/dex_cache.h
@@ -26,9 +26,15 @@ class MANAGED CodeAndDirectMethods : public IntArray {
return reinterpret_cast<Method*>(Get(MethodIndex(method_idx)));
}
- void SetResolvedDirectMethodTrampoline(uint32_t method_idx) {
- UNIMPLEMENTED(WARNING) << "need to install a trampoline to resolve the method_idx at runtime";
- Set(CodeIndex(method_idx), 0xffffffff);
+ void SetResolvedDirectMethodTrampoline(uint32_t method_idx, ByteArray* code_array,
+ InstructionSet instruction_set) {
+ DCHECK(code_array != NULL);
+ int32_t code = reinterpret_cast<int32_t>(code_array->GetData());
+ if (instruction_set == kThumb2) {
+ // Set the low-order bit so a BLX will switch to Thumb mode
+ code = code | 0x1;
+ }
+ Set(CodeIndex(method_idx), code);
Set(MethodIndex(method_idx), method_idx);
}