Mercurial > hg > graal-jvmci-8
annotate graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/PiNode.java @ 4648:83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Mon, 20 Feb 2012 14:29:51 +0100 |
parents | |
children |
rev | line source |
---|---|
4648
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
1 /* |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
2 * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved. |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
4 * |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
8 * |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
13 * accompanied this code). |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
14 * |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
18 * |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
21 * questions. |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
22 */ |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
23 package com.oracle.max.graal.nodes; |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
24 |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
25 import com.oracle.max.graal.nodes.calc.*; |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
26 import com.oracle.max.graal.nodes.spi.*; |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
27 import com.oracle.max.graal.nodes.type.*; |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
28 |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
29 |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
30 public class PiNode extends FloatingNode implements LIRLowerable { |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
31 |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
32 @Input private ValueNode value; |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
33 @Input private BeginNode anchor; |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
34 |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
35 public ValueNode value() { |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
36 return value; |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
37 } |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
38 |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
39 public BeginNode anchor() { |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
40 return anchor; |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
41 } |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
42 |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
43 public PiNode(ValueNode value, BeginNode anchor, Stamp stamp) { |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
44 super(stamp); |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
45 this.value = value; |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
46 this.anchor = anchor; |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
47 } |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
48 |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
49 @Override |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
50 public void generate(LIRGeneratorTool generator) { |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
51 generator.setResult(this, generator.operand(value)); |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
52 } |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
53 } |