diff options
| author | 2015-10-20 11:41:49 +0000 | |
|---|---|---|
| committer | 2015-10-20 11:41:49 +0000 | |
| commit | 94e24ac0e9e2bad74e9beecbd068f2b87798b815 (patch) | |
| tree | ad07cc96f633bdae839ff2f1553d84b9c864a930 /runtime/arch/context.h | |
| parent | b697c447eb61c2e14315166ec3b0d16375ae403c (diff) | |
| parent | 524e7ea8cd17bad17bd9f3e0ccbb19ad0d4d9c02 (diff) | |
Merge "Remove ArtCode."
Diffstat (limited to 'runtime/arch/context.h')
| -rw-r--r-- | runtime/arch/context.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/runtime/arch/context.h b/runtime/arch/context.h index 9af7c04f5c..a50064851b 100644 --- a/runtime/arch/context.h +++ b/runtime/arch/context.h @@ -25,7 +25,7 @@ namespace art { -class StackVisitor; +class QuickMethodFrameInfo; // Representation of a thread's context on the executing machine, used to implement long jumps in // the quick stack frame layout. @@ -39,10 +39,18 @@ class Context { // Re-initializes the registers for context re-use. virtual void Reset() = 0; + static uintptr_t* CalleeSaveAddress(uint8_t* frame, int num, size_t frame_size) { + // Callee saves are held at the top of the frame + uint8_t* save_addr = frame + frame_size - ((num + 1) * sizeof(void*)); +#if defined(__i386__) || defined(__x86_64__) + save_addr -= sizeof(void*); // account for return address +#endif + return reinterpret_cast<uintptr_t*>(save_addr); + } + // Reads values from callee saves in the given frame. The frame also holds // the method that holds the layout. - virtual void FillCalleeSaves(const StackVisitor& fr) - SHARED_REQUIRES(Locks::mutator_lock_) = 0; + virtual void FillCalleeSaves(uint8_t* frame, const QuickMethodFrameInfo& fr) = 0; // Sets the stack pointer value. virtual void SetSP(uintptr_t new_sp) = 0; |