Mercurial > hg > truffle
annotate graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotLIRGenerator.java @ 15456:bb97b75d1d65
AMD64: implemented DeoptimizationStub.deoptimizationHandler
author | twisti |
---|---|
date | Wed, 30 Apr 2014 15:41:44 -1000 |
parents | 8065d79ccd49 |
children | cf994cc23b54 |
rev | line source |
---|---|
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
1 /* |
15104 | 2 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. |
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
4 * |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
8 * |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
14 * |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
18 * |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
21 * questions. |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
22 */ |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
23 |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
24 package com.oracle.graal.hotspot.hsail; |
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
25 |
14768
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
14723
diff
changeset
|
26 import static com.oracle.graal.api.code.ValueUtil.*; |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
14723
diff
changeset
|
27 |
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
28 import com.oracle.graal.api.code.*; |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
29 import com.oracle.graal.api.meta.*; |
15193
96bb07a5d667
Spit up and move GraalInternalError.
Josef Eisl <josef.eisl@jku.at>
parents:
15104
diff
changeset
|
30 import com.oracle.graal.compiler.common.*; |
15200
97eed257999b
Move Condition to graal.compiler.common.
Josef Eisl <josef.eisl@jku.at>
parents:
15193
diff
changeset
|
31 import com.oracle.graal.compiler.common.calc.*; |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
32 import com.oracle.graal.compiler.hsail.*; |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
33 import com.oracle.graal.hotspot.*; |
14723
4c5ed5a670ed
HSAIL: implemented storing compressed constants and made HSAILHotSpotLIRGenerator implement HotSpotLIRGenerator
Doug Simon <doug.simon@oracle.com>
parents:
14633
diff
changeset
|
34 import com.oracle.graal.hotspot.HotSpotVMConfig.CompressEncoding; |
4c5ed5a670ed
HSAIL: implemented storing compressed constants and made HSAILHotSpotLIRGenerator implement HotSpotLIRGenerator
Doug Simon <doug.simon@oracle.com>
parents:
14633
diff
changeset
|
35 import com.oracle.graal.hotspot.meta.*; |
14945
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
36 import com.oracle.graal.hotspot.nodes.type.*; |
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
37 import com.oracle.graal.lir.*; |
15104 | 38 import com.oracle.graal.lir.StandardOp.SaveRegistersOp; |
15292
a38d791982e1
Move LIRGenerationResult* to graal.lir.
Josef Eisl <josef.eisl@jku.at>
parents:
15252
diff
changeset
|
39 import com.oracle.graal.lir.gen.*; |
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
40 import com.oracle.graal.lir.hsail.*; |
15301
468b2428c403
Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents:
15292
diff
changeset
|
41 import com.oracle.graal.lir.hsail.HSAILControlFlow.CondMoveOp; |
468b2428c403
Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents:
15292
diff
changeset
|
42 import com.oracle.graal.lir.hsail.HSAILControlFlow.DeoptimizeOp; |
468b2428c403
Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents:
15292
diff
changeset
|
43 import com.oracle.graal.lir.hsail.HSAILControlFlow.ForeignCall1ArgOp; |
468b2428c403
Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents:
15292
diff
changeset
|
44 import com.oracle.graal.lir.hsail.HSAILControlFlow.ForeignCall2ArgOp; |
468b2428c403
Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents:
15292
diff
changeset
|
45 import com.oracle.graal.lir.hsail.HSAILControlFlow.ForeignCallNoArgOp; |
468b2428c403
Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents:
15292
diff
changeset
|
46 import com.oracle.graal.lir.hsail.HSAILMove.CompareAndSwapOp; |
468b2428c403
Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents:
15292
diff
changeset
|
47 import com.oracle.graal.lir.hsail.HSAILMove.LoadOp; |
468b2428c403
Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents:
15292
diff
changeset
|
48 import com.oracle.graal.lir.hsail.HSAILMove.MoveFromRegOp; |
468b2428c403
Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents:
15292
diff
changeset
|
49 import com.oracle.graal.lir.hsail.HSAILMove.MoveToRegOp; |
468b2428c403
Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents:
15292
diff
changeset
|
50 import com.oracle.graal.lir.hsail.HSAILMove.StoreConstantOp; |
468b2428c403
Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents:
15292
diff
changeset
|
51 import com.oracle.graal.lir.hsail.HSAILMove.StoreOp; |
14768
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
14723
diff
changeset
|
52 import com.oracle.graal.phases.util.*; |
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
53 |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
54 /** |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
55 * The HotSpot specific portion of the HSAIL LIR generator. |
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
56 */ |
14945
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
57 public class HSAILHotSpotLIRGenerator extends HSAILLIRGenerator implements HotSpotLIRGenerator { |
14768
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
14723
diff
changeset
|
58 |
14846
43cd57700476
Apply LIRGenerator refactoring to HSAIL backend.
Josef Eisl <josef.eisl@jku.at>
parents:
14826
diff
changeset
|
59 final HotSpotVMConfig config; |
14768
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
14723
diff
changeset
|
60 |
14846
43cd57700476
Apply LIRGenerator refactoring to HSAIL backend.
Josef Eisl <josef.eisl@jku.at>
parents:
14826
diff
changeset
|
61 public HSAILHotSpotLIRGenerator(Providers providers, HotSpotVMConfig config, CallingConvention cc, LIRGenerationResult lirGenRes) { |
43cd57700476
Apply LIRGenerator refactoring to HSAIL backend.
Josef Eisl <josef.eisl@jku.at>
parents:
14826
diff
changeset
|
62 super(providers, cc, lirGenRes); |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
63 this.config = config; |
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
64 } |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
65 |
14723
4c5ed5a670ed
HSAIL: implemented storing compressed constants and made HSAILHotSpotLIRGenerator implement HotSpotLIRGenerator
Doug Simon <doug.simon@oracle.com>
parents:
14633
diff
changeset
|
66 @Override |
4c5ed5a670ed
HSAIL: implemented storing compressed constants and made HSAILHotSpotLIRGenerator implement HotSpotLIRGenerator
Doug Simon <doug.simon@oracle.com>
parents:
14633
diff
changeset
|
67 public HotSpotProviders getProviders() { |
4c5ed5a670ed
HSAIL: implemented storing compressed constants and made HSAILHotSpotLIRGenerator implement HotSpotLIRGenerator
Doug Simon <doug.simon@oracle.com>
parents:
14633
diff
changeset
|
68 return (HotSpotProviders) super.getProviders(); |
4c5ed5a670ed
HSAIL: implemented storing compressed constants and made HSAILHotSpotLIRGenerator implement HotSpotLIRGenerator
Doug Simon <doug.simon@oracle.com>
parents:
14633
diff
changeset
|
69 } |
4c5ed5a670ed
HSAIL: implemented storing compressed constants and made HSAILHotSpotLIRGenerator implement HotSpotLIRGenerator
Doug Simon <doug.simon@oracle.com>
parents:
14633
diff
changeset
|
70 |
14846
43cd57700476
Apply LIRGenerator refactoring to HSAIL backend.
Josef Eisl <josef.eisl@jku.at>
parents:
14826
diff
changeset
|
71 int getLogMinObjectAlignment() { |
12698
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
72 return config.logMinObjAlignment(); |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
73 } |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
74 |
14846
43cd57700476
Apply LIRGenerator refactoring to HSAIL backend.
Josef Eisl <josef.eisl@jku.at>
parents:
14826
diff
changeset
|
75 int getNarrowOopShift() { |
12698
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
76 return config.narrowOopShift; |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
77 } |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
78 |
14846
43cd57700476
Apply LIRGenerator refactoring to HSAIL backend.
Josef Eisl <josef.eisl@jku.at>
parents:
14826
diff
changeset
|
79 long getNarrowOopBase() { |
12698
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
80 return config.narrowOopBase; |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
81 } |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
82 |
14846
43cd57700476
Apply LIRGenerator refactoring to HSAIL backend.
Josef Eisl <josef.eisl@jku.at>
parents:
14826
diff
changeset
|
83 int getLogKlassAlignment() { |
12698
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
84 return config.logKlassAlignment; |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
85 } |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
86 |
14846
43cd57700476
Apply LIRGenerator refactoring to HSAIL backend.
Josef Eisl <josef.eisl@jku.at>
parents:
14826
diff
changeset
|
87 int getNarrowKlassShift() { |
12698
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
88 return config.narrowKlassShift; |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
89 } |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
90 |
14846
43cd57700476
Apply LIRGenerator refactoring to HSAIL backend.
Josef Eisl <josef.eisl@jku.at>
parents:
14826
diff
changeset
|
91 long getNarrowKlassBase() { |
12698
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
92 return config.narrowKlassBase; |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
93 } |
d59a65c11feb
HSAIL support for difference between compression of oops and class pointers
Doug Simon <doug.simon@oracle.com>
parents:
12664
diff
changeset
|
94 |
13891
bc471f405eb8
HSAIL: support for storing immediates
Doug Simon <doug.simon@oracle.com>
parents:
13291
diff
changeset
|
95 @Override |
bc471f405eb8
HSAIL: support for storing immediates
Doug Simon <doug.simon@oracle.com>
parents:
13291
diff
changeset
|
96 public boolean canStoreConstant(Constant c, boolean isCompressed) { |
bc471f405eb8
HSAIL: support for storing immediates
Doug Simon <doug.simon@oracle.com>
parents:
13291
diff
changeset
|
97 return true; |
bc471f405eb8
HSAIL: support for storing immediates
Doug Simon <doug.simon@oracle.com>
parents:
13291
diff
changeset
|
98 } |
bc471f405eb8
HSAIL: support for storing immediates
Doug Simon <doug.simon@oracle.com>
parents:
13291
diff
changeset
|
99 |
14945
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
100 private static Kind getMemoryKind(PlatformKind kind) { |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
101 if (kind == NarrowOopStamp.NarrowOop) { |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
102 return Kind.Int; |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
103 } else { |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
104 return (Kind) kind; |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
105 } |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
106 } |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
107 |
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
108 @Override |
15301
468b2428c403
Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents:
15292
diff
changeset
|
109 public Variable emitLoad(PlatformKind kind, Value address, LIRFrameState state) { |
10769 | 110 HSAILAddressValue loadAddress = asAddressValue(address); |
14945
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
111 Variable result = newVariable(kind); |
15302
b3e4b32cb9f5
Remove deprecated isCompressed* checks from *HotSpotLIRGenerator.
Josef Eisl <josef.eisl@jku.at>
parents:
15301
diff
changeset
|
112 if (kind == NarrowOopStamp.NarrowOop) { |
14945
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
113 append(new LoadOp(Kind.Int, result, loadAddress, state)); |
10769 | 114 } else { |
14945
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
115 append(new LoadOp(getMemoryKind(kind), result, loadAddress, state)); |
10769 | 116 } |
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
117 return result; |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
118 } |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
119 |
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
120 @Override |
15301
468b2428c403
Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents:
15292
diff
changeset
|
121 public void emitStore(PlatformKind kind, Value address, Value inputVal, LIRFrameState state) { |
10769 | 122 HSAILAddressValue storeAddress = asAddressValue(address); |
13891
bc471f405eb8
HSAIL: support for storing immediates
Doug Simon <doug.simon@oracle.com>
parents:
13291
diff
changeset
|
123 if (isConstant(inputVal)) { |
bc471f405eb8
HSAIL: support for storing immediates
Doug Simon <doug.simon@oracle.com>
parents:
13291
diff
changeset
|
124 Constant c = asConstant(inputVal); |
15302
b3e4b32cb9f5
Remove deprecated isCompressed* checks from *HotSpotLIRGenerator.
Josef Eisl <josef.eisl@jku.at>
parents:
15301
diff
changeset
|
125 if (canStoreConstant(c, false)) { |
b3e4b32cb9f5
Remove deprecated isCompressed* checks from *HotSpotLIRGenerator.
Josef Eisl <josef.eisl@jku.at>
parents:
15301
diff
changeset
|
126 append(new StoreConstantOp(getMemoryKind(kind), storeAddress, c, state)); |
b3e4b32cb9f5
Remove deprecated isCompressed* checks from *HotSpotLIRGenerator.
Josef Eisl <josef.eisl@jku.at>
parents:
15301
diff
changeset
|
127 return; |
13891
bc471f405eb8
HSAIL: support for storing immediates
Doug Simon <doug.simon@oracle.com>
parents:
13291
diff
changeset
|
128 } |
bc471f405eb8
HSAIL: support for storing immediates
Doug Simon <doug.simon@oracle.com>
parents:
13291
diff
changeset
|
129 } |
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
130 Variable input = load(inputVal); |
15302
b3e4b32cb9f5
Remove deprecated isCompressed* checks from *HotSpotLIRGenerator.
Josef Eisl <josef.eisl@jku.at>
parents:
15301
diff
changeset
|
131 if (kind == NarrowOopStamp.NarrowOop) { |
14945
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
132 append(new StoreOp(Kind.Int, storeAddress, input, state)); |
10769 | 133 } else { |
14945
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
134 append(new StoreOp(getMemoryKind(kind), storeAddress, input, state)); |
10769 | 135 } |
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
136 } |
12664
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
137 |
15024
2ee777221036
Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
15018
diff
changeset
|
138 public Value emitCompareAndSwap(Value address, Value expectedValue, Value newValue, Value trueValue, Value falseValue) { |
2ee777221036
Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
15018
diff
changeset
|
139 PlatformKind kind = newValue.getPlatformKind(); |
2ee777221036
Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
15018
diff
changeset
|
140 assert kind == expectedValue.getPlatformKind(); |
2ee777221036
Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
15018
diff
changeset
|
141 Kind memKind = getMemoryKind(kind); |
2ee777221036
Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
15018
diff
changeset
|
142 |
2ee777221036
Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
15018
diff
changeset
|
143 HSAILAddressValue addressValue = asAddressValue(address); |
2ee777221036
Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
15018
diff
changeset
|
144 Variable expected = emitMove(expectedValue); |
2ee777221036
Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
15018
diff
changeset
|
145 Variable casResult = newVariable(kind); |
2ee777221036
Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
15018
diff
changeset
|
146 append(new CompareAndSwapOp(memKind, casResult, addressValue, expected, asAllocatable(newValue))); |
2ee777221036
Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
15018
diff
changeset
|
147 |
2ee777221036
Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
15018
diff
changeset
|
148 assert trueValue.getPlatformKind() == falseValue.getPlatformKind(); |
2ee777221036
Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
15018
diff
changeset
|
149 Variable nodeResult = newVariable(trueValue.getPlatformKind()); |
2ee777221036
Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
15018
diff
changeset
|
150 append(new CondMoveOp(HSAILLIRGenerator.mapKindToCompareOp(memKind), casResult, expected, nodeResult, Condition.EQ, trueValue, falseValue)); |
2ee777221036
Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
15018
diff
changeset
|
151 return nodeResult; |
2ee777221036
Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
15018
diff
changeset
|
152 } |
2ee777221036
Use high level CompressionNode in lowering of CompareAndSwapNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
15018
diff
changeset
|
153 |
15344
8065d79ccd49
HSAIL: fixed AtomicReadAndWrite support
Doug Simon <doug.simon@oracle.com>
parents:
15302
diff
changeset
|
154 @Override |
15251 | 155 public Value emitAtomicReadAndAdd(Value address, Value delta) { |
156 PlatformKind kind = delta.getPlatformKind(); | |
157 Kind memKind = getMemoryKind(kind); | |
158 Variable result = newVariable(kind); | |
159 HSAILAddressValue addressValue = asAddressValue(address); | |
160 append(new HSAILMove.AtomicReadAndAddOp(memKind, result, addressValue, asAllocatable(delta))); | |
161 return result; | |
162 } | |
163 | |
14768
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
14723
diff
changeset
|
164 @Override |
15344
8065d79ccd49
HSAIL: fixed AtomicReadAndWrite support
Doug Simon <doug.simon@oracle.com>
parents:
15302
diff
changeset
|
165 public Value emitAtomicReadAndWrite(Value address, Value newValue) { |
8065d79ccd49
HSAIL: fixed AtomicReadAndWrite support
Doug Simon <doug.simon@oracle.com>
parents:
15302
diff
changeset
|
166 PlatformKind kind = newValue.getPlatformKind(); |
8065d79ccd49
HSAIL: fixed AtomicReadAndWrite support
Doug Simon <doug.simon@oracle.com>
parents:
15302
diff
changeset
|
167 Kind memKind = getMemoryKind(kind); |
8065d79ccd49
HSAIL: fixed AtomicReadAndWrite support
Doug Simon <doug.simon@oracle.com>
parents:
15302
diff
changeset
|
168 Variable result = newVariable(kind); |
8065d79ccd49
HSAIL: fixed AtomicReadAndWrite support
Doug Simon <doug.simon@oracle.com>
parents:
15302
diff
changeset
|
169 HSAILAddressValue addressValue = asAddressValue(address); |
8065d79ccd49
HSAIL: fixed AtomicReadAndWrite support
Doug Simon <doug.simon@oracle.com>
parents:
15302
diff
changeset
|
170 append(new HSAILMove.AtomicReadAndWriteOp(memKind, result, addressValue, asAllocatable(newValue))); |
8065d79ccd49
HSAIL: fixed AtomicReadAndWrite support
Doug Simon <doug.simon@oracle.com>
parents:
15302
diff
changeset
|
171 return result; |
8065d79ccd49
HSAIL: fixed AtomicReadAndWrite support
Doug Simon <doug.simon@oracle.com>
parents:
15302
diff
changeset
|
172 } |
8065d79ccd49
HSAIL: fixed AtomicReadAndWrite support
Doug Simon <doug.simon@oracle.com>
parents:
15302
diff
changeset
|
173 |
8065d79ccd49
HSAIL: fixed AtomicReadAndWrite support
Doug Simon <doug.simon@oracle.com>
parents:
15302
diff
changeset
|
174 @Override |
15301
468b2428c403
Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents:
15292
diff
changeset
|
175 public void emitDeoptimize(Value actionAndReason, Value failedSpeculation, LIRFrameState state) { |
468b2428c403
Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents:
15292
diff
changeset
|
176 emitDeoptimizeInner(actionAndReason, state, "emitDeoptimize"); |
14768
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
14723
diff
changeset
|
177 } |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
14723
diff
changeset
|
178 |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
14723
diff
changeset
|
179 /*** |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
14723
diff
changeset
|
180 * We need 64-bit and 32-bit scratch registers for the codegen $s0 can be live at this block. |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
14723
diff
changeset
|
181 */ |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
14723
diff
changeset
|
182 private void emitDeoptimizeInner(Value actionAndReason, LIRFrameState lirFrameState, String emitName) { |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
14723
diff
changeset
|
183 DeoptimizeOp deopt = new DeoptimizeOp(actionAndReason, lirFrameState, emitName, getMetaAccess()); |
14921
88dfaf6448e0
Remove LIRGenerationResult from NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents:
14853
diff
changeset
|
184 ((HSAILHotSpotLIRGenerationResult) getResult()).addDeopt(deopt); |
14768
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
14723
diff
changeset
|
185 append(deopt); |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
14723
diff
changeset
|
186 } |
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
14723
diff
changeset
|
187 |
12664
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
188 /*** |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
189 * This is a very temporary solution to emitForeignCall. We don't really support foreign calls |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
190 * yet, but we do want to generate dummy code for them. The ForeignCallXXXOps just end up |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
191 * emitting a comment as to what Foreign call they would have made. |
14768
3e9a960f0da1
HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents:
14723
diff
changeset
|
192 */ |
12664
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
193 @Override |
15301
468b2428c403
Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents:
15292
diff
changeset
|
194 public Variable emitForeignCall(ForeignCallLinkage linkage, LIRFrameState state, Value... args) { |
12664
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
195 Variable result = newVariable(Kind.Object); // linkage.getDescriptor().getResultType()); |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
196 |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
197 // to make the LIRVerifier happy, we move any constants into registers |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
198 Value[] argLocations = new Value[args.length]; |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
199 for (int i = 0; i < args.length; i++) { |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
200 Value arg = args[i]; |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
201 AllocatableValue loc = newVariable(arg.getKind()); |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
202 emitMove(loc, arg); |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
203 argLocations[i] = loc; |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
204 } |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
205 |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
206 // here we could check the callName if we wanted to only handle certain callnames |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
207 String callName = linkage.getDescriptor().getName(); |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
208 switch (argLocations.length) { |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
209 case 0: |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
210 append(new ForeignCallNoArgOp(callName, result)); |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
211 break; |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
212 case 1: |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
213 append(new ForeignCall1ArgOp(callName, result, argLocations[0])); |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
214 break; |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
215 case 2: |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
216 append(new ForeignCall2ArgOp(callName, result, argLocations[0], argLocations[1])); |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
217 break; |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
218 default: |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
219 throw new InternalError("NYI emitForeignCall " + callName + ", " + argLocations.length + ", " + linkage); |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
220 } |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
221 return result; |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
222 } |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
223 |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
224 @Override |
14945
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
225 protected HSAILLIRInstruction createMove(AllocatableValue dst, Value src) { |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
226 if (dst.getPlatformKind() == NarrowOopStamp.NarrowOop) { |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
227 if (isRegister(src) || isStackSlot(dst)) { |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
228 return new MoveFromRegOp(Kind.Int, dst, src); |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
229 } else { |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
230 return new MoveToRegOp(Kind.Int, dst, src); |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
231 } |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
232 } else { |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
233 return super.createMove(dst, src); |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
234 } |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
235 } |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
236 |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
237 @Override |
12664
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
238 protected void emitForeignCall(ForeignCallLinkage linkage, Value result, Value[] arguments, Value[] temps, LIRFrameState info) { |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
239 // this version of emitForeignCall not used for now |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
240 } |
1fdecc36c8ac
HSAIL updates to integrate recent changes to the providers infrastructure.
Doug Simon <doug.simon@oracle.com>
parents:
12559
diff
changeset
|
241 |
14723
4c5ed5a670ed
HSAIL: implemented storing compressed constants and made HSAILHotSpotLIRGenerator implement HotSpotLIRGenerator
Doug Simon <doug.simon@oracle.com>
parents:
14633
diff
changeset
|
242 /** |
4c5ed5a670ed
HSAIL: implemented storing compressed constants and made HSAILHotSpotLIRGenerator implement HotSpotLIRGenerator
Doug Simon <doug.simon@oracle.com>
parents:
14633
diff
changeset
|
243 * @return a compressed version of the incoming constant lifted from AMD64HotSpotLIRGenerator |
4c5ed5a670ed
HSAIL: implemented storing compressed constants and made HSAILHotSpotLIRGenerator implement HotSpotLIRGenerator
Doug Simon <doug.simon@oracle.com>
parents:
14633
diff
changeset
|
244 */ |
4c5ed5a670ed
HSAIL: implemented storing compressed constants and made HSAILHotSpotLIRGenerator implement HotSpotLIRGenerator
Doug Simon <doug.simon@oracle.com>
parents:
14633
diff
changeset
|
245 protected static Constant compress(Constant c, CompressEncoding encoding) { |
4c5ed5a670ed
HSAIL: implemented storing compressed constants and made HSAILHotSpotLIRGenerator implement HotSpotLIRGenerator
Doug Simon <doug.simon@oracle.com>
parents:
14633
diff
changeset
|
246 if (c.getKind() == Kind.Long) { |
15018
db4254246f9a
Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14945
diff
changeset
|
247 int compressedValue = (int) (((c.asLong() - encoding.base) >> encoding.shift) & 0xffffffffL); |
db4254246f9a
Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14945
diff
changeset
|
248 if (c instanceof HotSpotMetaspaceConstant) { |
db4254246f9a
Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14945
diff
changeset
|
249 return HotSpotMetaspaceConstant.forMetaspaceObject(Kind.Int, compressedValue, HotSpotMetaspaceConstant.getMetaspaceObject(c)); |
db4254246f9a
Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14945
diff
changeset
|
250 } else { |
db4254246f9a
Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14945
diff
changeset
|
251 return Constant.forIntegerKind(Kind.Int, compressedValue); |
db4254246f9a
Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14945
diff
changeset
|
252 } |
14723
4c5ed5a670ed
HSAIL: implemented storing compressed constants and made HSAILHotSpotLIRGenerator implement HotSpotLIRGenerator
Doug Simon <doug.simon@oracle.com>
parents:
14633
diff
changeset
|
253 } else { |
4c5ed5a670ed
HSAIL: implemented storing compressed constants and made HSAILHotSpotLIRGenerator implement HotSpotLIRGenerator
Doug Simon <doug.simon@oracle.com>
parents:
14633
diff
changeset
|
254 throw GraalInternalError.shouldNotReachHere(); |
4c5ed5a670ed
HSAIL: implemented storing compressed constants and made HSAILHotSpotLIRGenerator implement HotSpotLIRGenerator
Doug Simon <doug.simon@oracle.com>
parents:
14633
diff
changeset
|
255 } |
4c5ed5a670ed
HSAIL: implemented storing compressed constants and made HSAILHotSpotLIRGenerator implement HotSpotLIRGenerator
Doug Simon <doug.simon@oracle.com>
parents:
14633
diff
changeset
|
256 } |
14945
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
257 |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
258 public void emitTailcall(Value[] args, Value address) { |
15104 | 259 throw GraalInternalError.unimplemented(); |
14945
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
260 } |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
261 |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
262 public void emitDeoptimizeCaller(DeoptimizationAction action, DeoptimizationReason reason) { |
15104 | 263 throw GraalInternalError.unimplemented(); |
14945
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
264 } |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
265 |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
266 public StackSlot getLockSlot(int lockDepth) { |
15104 | 267 throw GraalInternalError.unimplemented(); |
14945
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
268 } |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
269 |
15058
895e9ecedfe8
Fix code generation for compressed metaspace pointers.
Roland Schatz <roland.schatz@oracle.com>
parents:
15024
diff
changeset
|
270 @Override |
895e9ecedfe8
Fix code generation for compressed metaspace pointers.
Roland Schatz <roland.schatz@oracle.com>
parents:
15024
diff
changeset
|
271 public Value emitCompress(Value pointer, CompressEncoding encoding, boolean nonNull) { |
14945
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
272 Variable result = newVariable(NarrowOopStamp.NarrowOop); |
15058
895e9ecedfe8
Fix code generation for compressed metaspace pointers.
Roland Schatz <roland.schatz@oracle.com>
parents:
15024
diff
changeset
|
273 append(new HSAILMove.CompressPointer(result, newVariable(pointer.getPlatformKind()), asAllocatable(pointer), encoding.base, encoding.shift, encoding.alignment, nonNull)); |
14945
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
274 return result; |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
275 } |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
276 |
15058
895e9ecedfe8
Fix code generation for compressed metaspace pointers.
Roland Schatz <roland.schatz@oracle.com>
parents:
15024
diff
changeset
|
277 @Override |
895e9ecedfe8
Fix code generation for compressed metaspace pointers.
Roland Schatz <roland.schatz@oracle.com>
parents:
15024
diff
changeset
|
278 public Value emitUncompress(Value pointer, CompressEncoding encoding, boolean nonNull) { |
14945
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
279 Variable result = newVariable(Kind.Object); |
15058
895e9ecedfe8
Fix code generation for compressed metaspace pointers.
Roland Schatz <roland.schatz@oracle.com>
parents:
15024
diff
changeset
|
280 append(new HSAILMove.UncompressPointer(result, asAllocatable(pointer), encoding.base, encoding.shift, encoding.alignment, nonNull)); |
14945
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
281 return result; |
b14cb2d9253d
Make compression and uncompression explicit in the high level graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
14921
diff
changeset
|
282 } |
15104 | 283 |
284 public SaveRegistersOp emitSaveAllRegisters() { | |
285 throw GraalInternalError.unimplemented(); | |
286 } | |
287 | |
10662
4ef92b67aeae
added HSAIL backend and tests
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
288 } |