annotate graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotLoweringProvider.java @ 18845:f57d86eb036f

removed Node factory methods
author Doug Simon <doug.simon@oracle.com>
date Mon, 12 Jan 2015 20:39:04 +0100
parents c240024b32b3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
1 /*
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
4 *
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
8 *
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
13 * accompanied this code).
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
14 *
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
18 *
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
21 * questions.
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
22 */
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
23 package com.oracle.graal.hotspot.hsail;
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
24
16841
cbd42807a31f moved NodeInfo and friends into separate com.oracle.graal.nodeinfo project so that annotation processor can be applied to the base Node class
Doug Simon <doug.simon@oracle.com>
parents: 15889
diff changeset
25 import java.util.*;
cbd42807a31f moved NodeInfo and friends into separate com.oracle.graal.nodeinfo project so that annotation processor can be applied to the base Node class
Doug Simon <doug.simon@oracle.com>
parents: 15889
diff changeset
26
12797
5341a7fca039 made HSAIL reuse HotSpotLoweringProvider, just with a different set of registers
Doug Simon <doug.simon@oracle.com>
parents: 12579
diff changeset
27 import com.oracle.graal.api.code.*;
5341a7fca039 made HSAIL reuse HotSpotLoweringProvider, just with a different set of registers
Doug Simon <doug.simon@oracle.com>
parents: 12579
diff changeset
28 import com.oracle.graal.api.meta.*;
15193
96bb07a5d667 Spit up and move GraalInternalError.
Josef Eisl <josef.eisl@jku.at>
parents: 15066
diff changeset
29 import com.oracle.graal.compiler.common.*;
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
30 import com.oracle.graal.graph.*;
12797
5341a7fca039 made HSAIL reuse HotSpotLoweringProvider, just with a different set of registers
Doug Simon <doug.simon@oracle.com>
parents: 12579
diff changeset
31 import com.oracle.graal.hotspot.*;
16841
cbd42807a31f moved NodeInfo and friends into separate com.oracle.graal.nodeinfo project so that annotation processor can be applied to the base Node class
Doug Simon <doug.simon@oracle.com>
parents: 15889
diff changeset
32 import com.oracle.graal.hotspot.hsail.replacements.*;
12797
5341a7fca039 made HSAIL reuse HotSpotLoweringProvider, just with a different set of registers
Doug Simon <doug.simon@oracle.com>
parents: 12579
diff changeset
33 import com.oracle.graal.hotspot.meta.*;
14768
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
34 import com.oracle.graal.nodes.*;
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
35 import com.oracle.graal.nodes.calc.*;
14768
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
36 import com.oracle.graal.nodes.extended.*;
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
37 import com.oracle.graal.nodes.java.*;
16841
cbd42807a31f moved NodeInfo and friends into separate com.oracle.graal.nodeinfo project so that annotation processor can be applied to the base Node class
Doug Simon <doug.simon@oracle.com>
parents: 15889
diff changeset
38 import com.oracle.graal.nodes.spi.*;
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
39
15398
70e4316c5785 Split HotSpotLoweringProvider into interface and implementation class.
Roland Schatz <roland.schatz@oracle.com>
parents: 14991
diff changeset
40 public class HSAILHotSpotLoweringProvider extends DefaultHotSpotLoweringProvider {
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
41
15066
2cae21d9f122 HSAIL: initial support for object allocation in HSAIL kernels
Doug Simon <doug.simon@oracle.com>
parents: 14991
diff changeset
42 private HSAILNewObjectSnippets.Templates hsailNewObjectSnippets;
2cae21d9f122 HSAIL: initial support for object allocation in HSAIL kernels
Doug Simon <doug.simon@oracle.com>
parents: 14991
diff changeset
43
2cae21d9f122 HSAIL: initial support for object allocation in HSAIL kernels
Doug Simon <doug.simon@oracle.com>
parents: 14991
diff changeset
44 abstract class LoweringStrategy {
14768
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
45 abstract void lower(Node n, LoweringTool tool);
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
46 }
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
47
18163
c88ab4f1f04a re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents: 17344
diff changeset
48 final LoweringStrategy passThruStrategy = new LoweringStrategy() {
14768
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
49 @Override
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
50 void lower(Node n, LoweringTool tool) {
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
51 return;
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
52 }
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
53 };
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
54
18163
c88ab4f1f04a re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents: 17344
diff changeset
55 final LoweringStrategy rejectStrategy = new LoweringStrategy() {
14768
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
56 @Override
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
57 void lower(Node n, LoweringTool tool) {
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
58 throw new GraalInternalError("Node implementing Lowerable not handled in HSAIL Backend: " + n);
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
59 }
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
60 };
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
61
18163
c88ab4f1f04a re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents: 17344
diff changeset
62 final LoweringStrategy newObjectStrategy = new LoweringStrategy() {
15066
2cae21d9f122 HSAIL: initial support for object allocation in HSAIL kernels
Doug Simon <doug.simon@oracle.com>
parents: 14991
diff changeset
63 @Override
2cae21d9f122 HSAIL: initial support for object allocation in HSAIL kernels
Doug Simon <doug.simon@oracle.com>
parents: 14991
diff changeset
64 void lower(Node n, LoweringTool tool) {
2cae21d9f122 HSAIL: initial support for object allocation in HSAIL kernels
Doug Simon <doug.simon@oracle.com>
parents: 14991
diff changeset
65 StructuredGraph graph = (StructuredGraph) n.graph();
2cae21d9f122 HSAIL: initial support for object allocation in HSAIL kernels
Doug Simon <doug.simon@oracle.com>
parents: 14991
diff changeset
66 if (graph.getGuardsStage() == StructuredGraph.GuardsStage.AFTER_FSA) {
2cae21d9f122 HSAIL: initial support for object allocation in HSAIL kernels
Doug Simon <doug.simon@oracle.com>
parents: 14991
diff changeset
67 if (n instanceof NewInstanceNode) {
2cae21d9f122 HSAIL: initial support for object allocation in HSAIL kernels
Doug Simon <doug.simon@oracle.com>
parents: 14991
diff changeset
68 hsailNewObjectSnippets.lower((NewInstanceNode) n, tool);
2cae21d9f122 HSAIL: initial support for object allocation in HSAIL kernels
Doug Simon <doug.simon@oracle.com>
parents: 14991
diff changeset
69 } else if (n instanceof NewArrayNode) {
18513
8b87897f5b42 introduced HotSpotGraalRuntimeProvder interface
Doug Simon <doug.simon@oracle.com>
parents: 18163
diff changeset
70 hsailNewObjectSnippets.lower((NewArrayNode) n, runtime, tool);
15066
2cae21d9f122 HSAIL: initial support for object allocation in HSAIL kernels
Doug Simon <doug.simon@oracle.com>
parents: 14991
diff changeset
71 }
2cae21d9f122 HSAIL: initial support for object allocation in HSAIL kernels
Doug Simon <doug.simon@oracle.com>
parents: 14991
diff changeset
72 }
2cae21d9f122 HSAIL: initial support for object allocation in HSAIL kernels
Doug Simon <doug.simon@oracle.com>
parents: 14991
diff changeset
73 }
2cae21d9f122 HSAIL: initial support for object allocation in HSAIL kernels
Doug Simon <doug.simon@oracle.com>
parents: 14991
diff changeset
74 };
2cae21d9f122 HSAIL: initial support for object allocation in HSAIL kernels
Doug Simon <doug.simon@oracle.com>
parents: 14991
diff changeset
75
14768
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
76 // strategy to replace an UnwindNode with a DeoptNode
18163
c88ab4f1f04a re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents: 17344
diff changeset
77 final LoweringStrategy unwindNodeStrategy = new LoweringStrategy() {
14768
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
78 @Override
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
79 void lower(Node n, LoweringTool tool) {
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
80 StructuredGraph graph = (StructuredGraph) n.graph();
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
81 UnwindNode unwind = (UnwindNode) n;
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
82 ValueNode exception = unwind.exception();
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
83 if (exception instanceof ForeignCallNode) {
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
84 // build up action and reason
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
85 String callName = ((ForeignCallNode) exception).getDescriptor().getName();
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
86 DeoptimizationReason reason;
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
87 switch (callName) {
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
88 case "createOutOfBoundsException":
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
89 reason = DeoptimizationReason.BoundsCheckException;
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
90 break;
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
91 case "createNullPointerException":
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
92 reason = DeoptimizationReason.NullCheckException;
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
93 break;
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
94 default:
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
95 reason = DeoptimizationReason.None;
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
96 }
18845
f57d86eb036f removed Node factory methods
Doug Simon <doug.simon@oracle.com>
parents: 18528
diff changeset
97 unwind.replaceAtPredecessor(graph.add(new DeoptimizeNode(DeoptimizationAction.InvalidateReprofile, reason)));
14768
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
98 unwind.safeDelete();
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
99 } else {
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
100 // unwind whose exception is not an instance of ForeignCallNode
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
101 throw new GraalInternalError("UnwindNode seen without ForeignCallNode: " + exception);
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
102 }
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
103 }
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
104 };
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
105
16905
a85d43d86ea1 indirect through NodeClass when looking up the HSAIL lowering strategy map
Doug Simon <doug.simon@oracle.com>
parents: 16895
diff changeset
106 private HashMap<NodeClass, LoweringStrategy> strategyMap = new HashMap<>();
15066
2cae21d9f122 HSAIL: initial support for object allocation in HSAIL kernels
Doug Simon <doug.simon@oracle.com>
parents: 14991
diff changeset
107
2cae21d9f122 HSAIL: initial support for object allocation in HSAIL kernels
Doug Simon <doug.simon@oracle.com>
parents: 14991
diff changeset
108 void initStrategyMap() {
18163
c88ab4f1f04a re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents: 17344
diff changeset
109 strategyMap.put(NodeClass.get(IntegerConvertNode.class), passThruStrategy);
c88ab4f1f04a re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents: 17344
diff changeset
110 strategyMap.put(NodeClass.get(FloatConvertNode.class), passThruStrategy);
c88ab4f1f04a re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents: 17344
diff changeset
111 strategyMap.put(NodeClass.get(NewInstanceNode.class), newObjectStrategy);
c88ab4f1f04a re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents: 17344
diff changeset
112 strategyMap.put(NodeClass.get(NewArrayNode.class), newObjectStrategy);
c88ab4f1f04a re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents: 17344
diff changeset
113 strategyMap.put(NodeClass.get(NewMultiArrayNode.class), rejectStrategy);
c88ab4f1f04a re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents: 17344
diff changeset
114 strategyMap.put(NodeClass.get(DynamicNewArrayNode.class), rejectStrategy);
c88ab4f1f04a re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents: 17344
diff changeset
115 strategyMap.put(NodeClass.get(MonitorEnterNode.class), rejectStrategy);
c88ab4f1f04a re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents: 17344
diff changeset
116 strategyMap.put(NodeClass.get(MonitorExitNode.class), rejectStrategy);
c88ab4f1f04a re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents: 17344
diff changeset
117 strategyMap.put(NodeClass.get(UnwindNode.class), unwindNodeStrategy);
14768
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
118 }
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
119
15066
2cae21d9f122 HSAIL: initial support for object allocation in HSAIL kernels
Doug Simon <doug.simon@oracle.com>
parents: 14991
diff changeset
120 private LoweringStrategy getStrategy(Node n) {
16905
a85d43d86ea1 indirect through NodeClass when looking up the HSAIL lowering strategy map
Doug Simon <doug.simon@oracle.com>
parents: 16895
diff changeset
121 return strategyMap.get(n.getNodeClass());
14768
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
122 }
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
123
18528
c240024b32b3 fixed eclipseformat issues
Doug Simon <doug.simon@oracle.com>
parents: 18524
diff changeset
124 public HSAILHotSpotLoweringProvider(HotSpotGraalRuntimeProvider runtime, MetaAccessProvider metaAccess, ForeignCallsProvider foreignCalls, HotSpotRegistersProvider registers,
c240024b32b3 fixed eclipseformat issues
Doug Simon <doug.simon@oracle.com>
parents: 18524
diff changeset
125 TargetDescription target) {
15889
8184c00fefd2 Factor out VM-independent part of DefaultHotSpotLoweringProvider into DefaultJavaLoweringProvider
Christian Wimmer <christian.wimmer@oracle.com>
parents: 15402
diff changeset
126 super(runtime, metaAccess, foreignCalls, registers, target);
15066
2cae21d9f122 HSAIL: initial support for object allocation in HSAIL kernels
Doug Simon <doug.simon@oracle.com>
parents: 14991
diff changeset
127 initStrategyMap();
2cae21d9f122 HSAIL: initial support for object allocation in HSAIL kernels
Doug Simon <doug.simon@oracle.com>
parents: 14991
diff changeset
128 }
2cae21d9f122 HSAIL: initial support for object allocation in HSAIL kernels
Doug Simon <doug.simon@oracle.com>
parents: 14991
diff changeset
129
2cae21d9f122 HSAIL: initial support for object allocation in HSAIL kernels
Doug Simon <doug.simon@oracle.com>
parents: 14991
diff changeset
130 @Override
2cae21d9f122 HSAIL: initial support for object allocation in HSAIL kernels
Doug Simon <doug.simon@oracle.com>
parents: 14991
diff changeset
131 public void initialize(HotSpotProviders providers, HotSpotVMConfig config) {
2cae21d9f122 HSAIL: initial support for object allocation in HSAIL kernels
Doug Simon <doug.simon@oracle.com>
parents: 14991
diff changeset
132 super.initialize(providers, config);
2cae21d9f122 HSAIL: initial support for object allocation in HSAIL kernels
Doug Simon <doug.simon@oracle.com>
parents: 14991
diff changeset
133 hsailNewObjectSnippets = new HSAILNewObjectSnippets.Templates(providers, target);
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
134 }
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
135
12797
5341a7fca039 made HSAIL reuse HotSpotLoweringProvider, just with a different set of registers
Doug Simon <doug.simon@oracle.com>
parents: 12579
diff changeset
136 @Override
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
137 public void lower(Node n, LoweringTool tool) {
14768
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
138 LoweringStrategy strategy = getStrategy(n);
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
139 // if not in map, let superclass handle it
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
140 if (strategy == null) {
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
141 super.lower(n, tool);
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
142 } else {
14768
3e9a960f0da1 HSAIL: preliminary deopt support
Doug Simon <doug.simon@oracle.com>
parents: 12797
diff changeset
143 strategy.lower(n, tool);
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
144 }
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
145 }
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
146
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
147 }