Mercurial > hg > graal-jvmci-8
comparison src/gpu/hsail/vm/gpu_hsail.hpp @ 15545:9d456ffc6120
HSAIL: fixed Windows build
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 07 May 2014 11:51:52 +0200 |
parents | a250a512434d |
children | 66d31e70bd79 |
comparison
equal
deleted
inserted
replaced
15544:217c721b1ee1 | 15545:9d456ffc6120 |
---|---|
30 #include "gpu_hsail_Frame.hpp" | 30 #include "gpu_hsail_Frame.hpp" |
31 | 31 |
32 class Hsail : public Gpu { | 32 class Hsail : public Gpu { |
33 | 33 |
34 public: | 34 public: |
35 class HSAILKernelDeoptimization { | 35 class HSAILKernelDeoptimization VALUE_OBJ_CLASS_SPEC { |
36 friend class VMStructs; | 36 friend class VMStructs; |
37 private: | 37 private: |
38 // TODO: separate workitemid and actionAndReason out | 38 // TODO: separate workitemid and actionAndReason out |
39 // since they are there only once even if there are multiple frames | 39 // since they are there only once even if there are multiple frames |
40 // for now, though we only ever have one hsail fram | 40 // for now, though we only ever have one hsail fram |
41 jint _workitemid; | 41 jint _workitemid; |
42 jint _actionAndReason; | 42 jint _actionAndReason; |
43 // the first (innermost) "hsail frame" starts here | 43 // the first (innermost) "hsail frame" starts after the above fields |
44 HSAILFrame _first_frame; | |
45 | 44 |
46 public: | 45 public: |
47 inline jint workitem() { return _workitemid; } | 46 inline jint workitem() { return _workitemid; } |
48 inline jint reason() { return _actionAndReason; } | 47 inline jint reason() { return _actionAndReason; } |
49 inline jint pc_offset() { return _first_frame.pc_offset(); } | 48 inline jint pc_offset() { return first_frame()->pc_offset(); } |
50 inline HSAILFrame *first_frame() { return &_first_frame; } | 49 inline HSAILFrame *first_frame() { |
50 // starts after the "header" fields | |
51 return (HSAILFrame *) (((jbyte *) this) + sizeof(*this)); | |
52 } | |
51 }; | 53 }; |
52 | 54 |
53 // 8 compute units * 40 waves per cu * wavesize 64 | 55 // 8 compute units * 40 waves per cu * wavesize 64 |
54 // TODO: query the device to get this number | 56 // TODO: query the device to get this number |
55 #define MAX_DEOPT_SLOTS (8 * 40 * 64) | 57 #define MAX_DEOPT_SLOTS (8 * 40 * 64) |
73 _notice_safepoints = &Hsail::_notice_safepoints; | 75 _notice_safepoints = &Hsail::_notice_safepoints; |
74 _deopt_occurred = 0; | 76 _deopt_occurred = 0; |
75 _deopt_next_index = 0; | 77 _deopt_next_index = 0; |
76 _num_slots = numSlots; | 78 _num_slots = numSlots; |
77 _bytesPerSaveArea = bytesPerSaveArea; | 79 _bytesPerSaveArea = bytesPerSaveArea; |
78 _deopt_span = sizeof(HSAILKernelDeoptimization) + bytesPerSaveArea; | 80 _deopt_span = sizeof(HSAILKernelDeoptimization) + sizeof(HSAILFrame) + bytesPerSaveArea; |
79 if (TraceGPUInteraction) { | 81 if (TraceGPUInteraction) { |
80 tty->print_cr("HSAILDeoptimizationInfo allocated, %d slots of size %d, total size = 0x%lx bytes", _num_slots, _deopt_span, (_num_slots * _deopt_span + sizeof(HSAILDeoptimizationInfo))); | 82 tty->print_cr("HSAILDeoptimizationInfo allocated, %d slots of size %d, total size = 0x%lx bytes", _num_slots, _deopt_span, (_num_slots * _deopt_span + sizeof(HSAILDeoptimizationInfo))); |
81 } | 83 } |
82 } | 84 } |
83 | 85 |