blob: 05cd43bd3117bcd8fbf0b73e2b064805c026cd34 [file] [log] [blame]
Ian Rogersbdb03912011-09-14 00:55:44 -07001// Copyright 2011 Google Inc. All Rights Reserved.
2
3#ifndef ART_SRC_CONTEXT_H_
4#define ART_SRC_CONTEXT_H_
5
6#include <stdint.h>
7
8namespace art {
9
10class Frame;
11
12// Representation of a thread's context on the executing machine
13class Context {
14 public:
15 // Creates a context for the running architecture
16 static Context* Create();
17
18 virtual ~Context() {}
19
20 // Read values from callee saves in the given frame. The frame also holds
21 // the method that holds the layout.
22 virtual void FillCalleeSaves(const Frame& fr) = 0;
23
24 // Set the stack pointer value
25 virtual void SetSP(uintptr_t new_sp) = 0;
26
27 // Set the program counter value
28 virtual void SetPC(uintptr_t new_pc) = 0;
29
30 // Switch execution of the executing context to this context
31 virtual void DoLongJump() = 0;
32};
33
34} // namespace art
35
36#endif // ART_SRC_CONTEXT_H_