blob: 10dcbb463356d2f739cb3765fdf20314191aba89 [file] [log] [blame]
Ian Rogersbdb03912011-09-14 00:55:44 -07001// Copyright 2011 Google Inc. All Rights Reserved.
2
3#ifndef ART_SRC_CONTEXT_X86_H_
4#define ART_SRC_CONTEXT_X86_H_
5
6#include "context.h"
7
Ian Rogers67375ac2011-09-14 00:55:44 -07008#include "constants_x86.h"
9
Ian Rogersbdb03912011-09-14 00:55:44 -070010namespace art {
11namespace x86 {
12
13class X86Context : public Context {
14 public:
Ian Rogers67375ac2011-09-14 00:55:44 -070015 X86Context();
Ian Rogersbdb03912011-09-14 00:55:44 -070016 virtual ~X86Context() {}
17
18 // No callee saves on X86
Ian Rogers67375ac2011-09-14 00:55:44 -070019 virtual void FillCalleeSaves(const Frame& fr);
Ian Rogersbdb03912011-09-14 00:55:44 -070020
21 virtual void SetSP(uintptr_t new_sp) {
Ian Rogers67375ac2011-09-14 00:55:44 -070022 gprs_[ESP] = new_sp;
Ian Rogersbdb03912011-09-14 00:55:44 -070023 }
24
25 virtual void SetPC(uintptr_t new_pc) {
26 eip_ = new_pc;
27 }
28
29 virtual void DoLongJump();
30
31 private:
Ian Rogers67375ac2011-09-14 00:55:44 -070032 uintptr_t gprs_[8];
Ian Rogersbdb03912011-09-14 00:55:44 -070033 uintptr_t eip_;
34};
35} // namespace x86
36} // namespace art
37
38#endif // ART_SRC_CONTEXT_X86_H_