Mercurial > hg > truffle
comparison src/gpu/hsail/vm/gpu_hsail_Frame.hpp @ 14768:3e9a960f0da1
HSAIL: preliminary deopt support
Contributed-by: Tom Deneau <tom.deneau@amd.com>
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 26 Mar 2014 17:33:54 +0100 |
parents | |
children | a250a512434d |
comparison
equal
deleted
inserted
replaced
14767:ded08e344e4a | 14768:3e9a960f0da1 |
---|---|
1 #ifndef GPU_HSAIL_FRAME_HPP | |
2 #define GPU_HSAIL_FRAME_HPP | |
3 | |
4 #include "graal/graalEnv.hpp" | |
5 #include "code/debugInfo.hpp" | |
6 #include "code/location.hpp" | |
7 | |
8 // maximum registers that could be saved for now | |
9 #define MAX_SREGS 32 | |
10 #define MAX_DREGS 16 | |
11 | |
12 class HSAILFrame { | |
13 friend class VMStructs; | |
14 private: | |
15 jint _pc_offset; // The HSAIL "pc_offset" where the exception happens | |
16 jbyte _num_s_regs; | |
17 jbyte _num_d_regs; | |
18 jshort _dreg_oops_map; // bits = 1 if that dreg is an oop | |
19 jlong _save_area[MAX_SREGS/2 + MAX_DREGS]; | |
20 | |
21 public: | |
22 // Accessors | |
23 jint pc_offset() { return _pc_offset; } | |
24 jint num_s_regs() {return _num_s_regs; } | |
25 jint num_d_regs() {return _num_d_regs; } | |
26 jint dreg_oops_map() {return _dreg_oops_map; } | |
27 jlong get_d_reg(int idx) { | |
28 char *p = (char *) _save_area; | |
29 int ofst = num_s_regs() * 4 + idx * 8; | |
30 return(*(jlong *) (p + ofst)); | |
31 } | |
32 jint get_s_reg(int idx) { | |
33 char *p = (char *) _save_area; | |
34 int ofst = idx * 4; | |
35 return(*(jint *) (p + ofst)); | |
36 } | |
37 void put_d_reg(int idx, jlong val) { | |
38 char *p = (char *) _save_area; | |
39 int ofst = num_s_regs() * 4 + idx * 8; | |
40 (*(jlong *) (p + ofst)) = val; | |
41 } | |
42 }; | |
43 | |
44 #endif // GPU_HSAIL_FRAME_HPP |