Mercurial > hg > truffle
annotate graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ComputeAddressNode.java @ 20074:a7ee2e1f0d4e
remove UnboxNodes without usages (if object is non-null)
author | Lukas Stadler <lukas.stadler@oracle.com> |
---|---|
date | Mon, 30 Mar 2015 13:59:59 +0200 |
parents | 8fc336a04d77 |
children | 48c1ebd24120 |
rev | line source |
---|---|
8507
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
1 /* |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
4 * |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
8 * |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
14 * |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
18 * |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
21 * questions. |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
22 */ |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
23 package com.oracle.graal.nodes.extended; |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
24 |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
25 import com.oracle.graal.api.meta.*; |
15198
2c0cfbf454b5
Move LIRTypeTool and Stamp to graal.compiler.common.
Josef Eisl <josef.eisl@jku.at>
parents:
15132
diff
changeset
|
26 import com.oracle.graal.compiler.common.type.*; |
19396
7e2c87dae93e
Create static final NodeClass field named TYPE in Node subclasses.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
19349
diff
changeset
|
27 import com.oracle.graal.graph.*; |
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:
16822
diff
changeset
|
28 import com.oracle.graal.nodeinfo.*; |
8507
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
29 import com.oracle.graal.nodes.*; |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
30 import com.oracle.graal.nodes.calc.*; |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
31 import com.oracle.graal.nodes.spi.*; |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
32 |
16822
5d468add216f
added @NodeInfo annotations to all Node classes
Doug Simon <doug.simon@oracle.com>
parents:
15198
diff
changeset
|
33 @NodeInfo |
18998
ec0733b5a90a
Allow final modifier on node subclasses and start adding the modifier to leaf classes.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18845
diff
changeset
|
34 public final class ComputeAddressNode extends FloatingNode implements LIRLowerable { |
8507
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
35 |
19526
8fc336a04d77
Create TYPE fields for LIRInstruction and CompositeValue. Renaming NodeClass#get to NodeClass#create.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
19403
diff
changeset
|
36 public static final NodeClass<ComputeAddressNode> TYPE = NodeClass.create(ComputeAddressNode.class); |
16897
f90dcdbbb75e
switched to using new NodeFieldIterator and NodeFieldIterable for traversing Node inputs and successors
Doug Simon <doug.simon@oracle.com>
parents:
16895
diff
changeset
|
37 @Input ValueNode object; |
f90dcdbbb75e
switched to using new NodeFieldIterator and NodeFieldIterable for traversing Node inputs and successors
Doug Simon <doug.simon@oracle.com>
parents:
16895
diff
changeset
|
38 @Input(InputType.Association) ValueNode location; |
8507
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
39 |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
40 public ValueNode getObject() { |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
41 return object; |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
42 } |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
43 |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
44 public LocationNode getLocation() { |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
45 return (LocationNode) location; |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
46 } |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
47 |
18845
f57d86eb036f
removed Node factory methods
Doug Simon <doug.simon@oracle.com>
parents:
17450
diff
changeset
|
48 public ComputeAddressNode(ValueNode object, ValueNode location, Stamp stamp) { |
19396
7e2c87dae93e
Create static final NodeClass field named TYPE in Node subclasses.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
19349
diff
changeset
|
49 super(TYPE, stamp); |
8507
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
50 this.object = object; |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
51 this.location = location; |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
52 } |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
53 |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
54 @Override |
14950
d5a1206e1923
NodeLIRBuilderTool: fix typo in interface name.
Josef Eisl <josef.eisl@jku.at>
parents:
14888
diff
changeset
|
55 public void generate(NodeLIRBuilderTool gen) { |
15130
ec22234bde0d
Pass more restricted interfaces to ArithmeticLIRLowerable and LocationNode in LIR generation.
Roland Schatz <roland.schatz@oracle.com>
parents:
14950
diff
changeset
|
56 Value addr = getLocation().generateAddress(gen, gen.getLIRGeneratorTool(), gen.operand(getObject())); |
19349
ff5b7f5063a3
Ensure ComputeAddressNode gets LIR-lowered to AllocatableValue
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18998
diff
changeset
|
57 gen.setResult(this, gen.getLIRGeneratorTool().asAllocatable(addr)); |
8507
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
58 } |
c92949b1ec8a
-Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff
changeset
|
59 } |