From 7cde48c56df5b57aed524cce44c902bc720f2d6c Mon Sep 17 00:00:00 2001 From: Sebastien Hertz Date: Tue, 20 Jan 2015 16:06:43 +0100 Subject: 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 --- runtime/stack_map.h | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'runtime/stack_map.h') 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(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); } -- cgit v1.2.3