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