summaryrefslogtreecommitdiffstats
path: root/runtime/stack_map.h
diff options
context:
space:
mode:
authorSebastien Hertz <shertz@google.com>2015-01-20 16:06:43 +0100
committerNicolas Geoffray <ngeoffray@google.com>2015-03-03 11:22:00 +0000
commit7cde48c56df5b57aed524cce44c902bc720f2d6c (patch)
treeb9b9e33b29f46bfe0c2da89c7e3e87c8ee419ccc /runtime/stack_map.h
parent4b39eeea67b0fecf21588d7b00e92eb844014c24 (diff)
downloadart-7cde48c56df5b57aed524cce44c902bc720f2d6c.tar.gz
art-7cde48c56df5b57aed524cce44c902bc720f2d6c.tar.bz2
art-7cde48c56df5b57aed524cce44c902bc720f2d6c.zip
Stack support for Optimizing compiler
Allows to read/write DEX registers from physical register or stack location when the method is compiled with the Optimizing compiler. Required fixing arm and arm64 JNI compiler by saving floating point registers. Bug: 18547544 Change-Id: I401579f251d1c0a130f6cf4a93a960cdcd7518f5
Diffstat (limited to 'runtime/stack_map.h')
-rw-r--r--runtime/stack_map.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/runtime/stack_map.h b/runtime/stack_map.h
index fd2236122..ec3769993 100644
--- a/runtime/stack_map.h
+++ b/runtime/stack_map.h
@@ -104,10 +104,9 @@ class DexRegisterMap {
return "in fpu register";
case kConstant:
return "as constant";
- default:
- LOG(FATAL) << "Invalid location kind " << static_cast<int>(kind);
- return nullptr;
}
+ UNREACHABLE();
+ return nullptr;
}
LocationKind GetLocationKind(uint16_t register_index) const {
@@ -126,6 +125,23 @@ class DexRegisterMap {
kFixedSize + sizeof(LocationKind) + register_index * SingleEntrySize());
}
+ int32_t GetStackOffsetInBytes(uint16_t register_index) const {
+ DCHECK(GetLocationKind(register_index) == kInStack);
+ // We currently encode the offset in bytes.
+ return GetValue(register_index);
+ }
+
+ int32_t GetConstant(uint16_t register_index) const {
+ DCHECK(GetLocationKind(register_index) == kConstant);
+ return GetValue(register_index);
+ }
+
+ int32_t GetMachineRegister(uint16_t register_index) const {
+ DCHECK(GetLocationKind(register_index) == kInRegister
+ || GetLocationKind(register_index) == kInFpuRegister);
+ return GetValue(register_index);
+ }
+
static size_t SingleEntrySize() {
return sizeof(LocationKind) + sizeof(int32_t);
}