Mercurial > hg > truffle
annotate src/gpu/hsail/vm/gpu_hsail_Frame.hpp @ 15710:8344485d71bd
[inlining] pulling side-effects (logging) out of method that evals a condition
author | Miguel Garcia <miguel.m.garcia@oracle.com> |
---|---|
date | Fri, 16 May 2014 14:57:45 +0200 |
parents | 9d456ffc6120 |
children | 06eedda53e14 |
rev | line source |
---|---|
15544 | 1 /* |
2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. | |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
20 * or visit www.oracle.com if you need additional information or have any | |
21 * questions. | |
22 * | |
23 */ | |
24 | |
14768
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
25 #ifndef GPU_HSAIL_FRAME_HPP |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
26 #define GPU_HSAIL_FRAME_HPP |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
27 |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
28 #include "graal/graalEnv.hpp" |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
29 #include "code/debugInfo.hpp" |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
30 #include "code/location.hpp" |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
31 |
15545
9d456ffc6120
HSAIL: fixed Windows build
Doug Simon <doug.simon@oracle.com>
parents:
15544
diff
changeset
|
32 class HSAILFrame VALUE_OBJ_CLASS_SPEC { |
14768
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
33 friend class VMStructs; |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
34 private: |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
35 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
|
36 jbyte _num_s_regs; |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
37 jbyte _num_d_regs; |
15482
a250a512434d
HSAIL: support for object values in stack slots at deoptimization points
Doug Simon <doug.simon@oracle.com>
parents:
14768
diff
changeset
|
38 jshort _num_stack_slots; |
14768
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
39 |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
40 public: |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
41 // Accessors |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
42 jint pc_offset() { return _pc_offset; } |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
43 jint num_s_regs() {return _num_s_regs; } |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
44 jint num_d_regs() {return _num_d_regs; } |
15482
a250a512434d
HSAIL: support for object values in stack slots at deoptimization points
Doug Simon <doug.simon@oracle.com>
parents:
14768
diff
changeset
|
45 jint num_stack_slots() {return _num_stack_slots; } |
15545
9d456ffc6120
HSAIL: fixed Windows build
Doug Simon <doug.simon@oracle.com>
parents:
15544
diff
changeset
|
46 jbyte * data_start() {return (jbyte *) this + sizeof(*this); } |
14768
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
47 jlong get_d_reg(int idx) { |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
48 int ofst = num_s_regs() * 4 + idx * 8; |
15545
9d456ffc6120
HSAIL: fixed Windows build
Doug Simon <doug.simon@oracle.com>
parents:
15544
diff
changeset
|
49 return(*(jlong *) (data_start() + ofst)); |
14768
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
50 } |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
51 jint get_s_reg(int idx) { |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
52 int ofst = idx * 4; |
15545
9d456ffc6120
HSAIL: fixed Windows build
Doug Simon <doug.simon@oracle.com>
parents:
15544
diff
changeset
|
53 return(*(jint *) (data_start() + ofst)); |
14768
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
54 } |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
55 void put_d_reg(int idx, jlong val) { |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
56 int ofst = num_s_regs() * 4 + idx * 8; |
15545
9d456ffc6120
HSAIL: fixed Windows build
Doug Simon <doug.simon@oracle.com>
parents:
15544
diff
changeset
|
57 (*(jlong *) (data_start() + ofst)) = val; |
15482
a250a512434d
HSAIL: support for object values in stack slots at deoptimization points
Doug Simon <doug.simon@oracle.com>
parents:
14768
diff
changeset
|
58 } |
a250a512434d
HSAIL: support for object values in stack slots at deoptimization points
Doug Simon <doug.simon@oracle.com>
parents:
14768
diff
changeset
|
59 jint get_stackslot32(int stackOffset) { |
a250a512434d
HSAIL: support for object values in stack slots at deoptimization points
Doug Simon <doug.simon@oracle.com>
parents:
14768
diff
changeset
|
60 int ofst = num_s_regs() * 4 + num_d_regs() * 8 + stackOffset; |
15545
9d456ffc6120
HSAIL: fixed Windows build
Doug Simon <doug.simon@oracle.com>
parents:
15544
diff
changeset
|
61 return(*(jint *) (data_start() + ofst)); |
15482
a250a512434d
HSAIL: support for object values in stack slots at deoptimization points
Doug Simon <doug.simon@oracle.com>
parents:
14768
diff
changeset
|
62 } |
a250a512434d
HSAIL: support for object values in stack slots at deoptimization points
Doug Simon <doug.simon@oracle.com>
parents:
14768
diff
changeset
|
63 jlong get_stackslot64(int stackOffset) { |
a250a512434d
HSAIL: support for object values in stack slots at deoptimization points
Doug Simon <doug.simon@oracle.com>
parents:
14768
diff
changeset
|
64 int ofst = num_s_regs() * 4 + num_d_regs() * 8 + stackOffset; |
15545
9d456ffc6120
HSAIL: fixed Windows build
Doug Simon <doug.simon@oracle.com>
parents:
15544
diff
changeset
|
65 return(*(jlong *) (data_start() + ofst)); |
15482
a250a512434d
HSAIL: support for object values in stack slots at deoptimization points
Doug Simon <doug.simon@oracle.com>
parents:
14768
diff
changeset
|
66 } |
a250a512434d
HSAIL: support for object values in stack slots at deoptimization points
Doug Simon <doug.simon@oracle.com>
parents:
14768
diff
changeset
|
67 void put_stackslot64(int stackOffset, jlong val) { |
a250a512434d
HSAIL: support for object values in stack slots at deoptimization points
Doug Simon <doug.simon@oracle.com>
parents:
14768
diff
changeset
|
68 int ofst = num_s_regs() * 4 + num_d_regs() * 8 + stackOffset; |
15545
9d456ffc6120
HSAIL: fixed Windows build
Doug Simon <doug.simon@oracle.com>
parents:
15544
diff
changeset
|
69 (*(jlong *) (data_start() + ofst)) = val; |
14768
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
70 } |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
71 }; |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
72 |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
73 #endif // GPU_HSAIL_FRAME_HPP |