annotate graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/MemoryPhiNode.java @ 18998:ec0733b5a90a

Allow final modifier on node subclasses and start adding the modifier to leaf classes.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Wed, 28 Jan 2015 02:34:14 +0100
parents a2cb19764970
children 7e2c87dae93e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13152
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
1 /*
14978
e302df8bf51c separate subclasses for value and guard phis and proxies
Lukas Stadler <lukas.stadler@oracle.com>
parents: 13153
diff changeset
2 * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
13152
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
4 *
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
8 *
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
13 * accompanied this code).
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
14 *
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
18 *
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
21 * questions.
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
22 */
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
23 package com.oracle.graal.nodes;
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
24
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
25 import com.oracle.graal.api.meta.*;
15261
882f4cb7cfcf Move Stamps to graal.compiler.common.
Josef Eisl <josef.eisl@jku.at>
parents: 15006
diff changeset
26 import com.oracle.graal.compiler.common.type.*;
14978
e302df8bf51c separate subclasses for value and guard phis and proxies
Lukas Stadler <lukas.stadler@oracle.com>
parents: 13153
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: 16550
diff changeset
28 import com.oracle.graal.nodeinfo.*;
13153
ae0001b445c0 Common base interface for nodes in the memory graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 13152
diff changeset
29 import com.oracle.graal.nodes.extended.*;
13152
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
30
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
31 /**
16475
6ce37ad3ea47 simplify MemoryPhiNodes and GuardPhiNodes with single values
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16438
diff changeset
32 * Memory {@code PhiNode}s merge memory dependencies at control flow merges.
13152
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
33 */
15002
06e50d290784 isAllowedUsageType on Nodes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15001
diff changeset
34 @NodeInfo(nameTemplate = "MemoryPhi({i#values}) {p#locationIdentity/s}", allowedUsageTypes = {InputType.Memory})
18998
ec0733b5a90a Allow final modifier on node subclasses and start adding the modifier to leaf classes.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 18995
diff changeset
35 public final class MemoryPhiNode extends PhiNode implements MemoryNode {
13152
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
36
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(InputType.Memory) NodeInputList<ValueNode> values;
17328
c9bb0da795d4 Backed out of changeset 17322:655f3e6b467b
Doug Simon <doug.simon@oracle.com>
parents: 17327
diff changeset
38 protected final LocationIdentity locationIdentity;
13152
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
39
18995
a2cb19764970 Rename MergeNode to AbstractMergeNode.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 18845
diff changeset
40 public MemoryPhiNode(AbstractMergeNode merge, LocationIdentity locationIdentity) {
15006
e60ea0bf468d remove StampFactory.dependency/extension/condition
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15002
diff changeset
41 super(StampFactory.forVoid(), merge);
14978
e302df8bf51c separate subclasses for value and guard phis and proxies
Lukas Stadler <lukas.stadler@oracle.com>
parents: 13153
diff changeset
42 this.locationIdentity = locationIdentity;
16550
af52fd81a7a3 initializing constructors for GuardPhiNode and MemoryPhiNode
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16475
diff changeset
43 this.values = new NodeInputList<>(this);
af52fd81a7a3 initializing constructors for GuardPhiNode and MemoryPhiNode
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16475
diff changeset
44 }
af52fd81a7a3 initializing constructors for GuardPhiNode and MemoryPhiNode
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16475
diff changeset
45
18995
a2cb19764970 Rename MergeNode to AbstractMergeNode.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 18845
diff changeset
46 public MemoryPhiNode(AbstractMergeNode merge, LocationIdentity locationIdentity, ValueNode[] values) {
16550
af52fd81a7a3 initializing constructors for GuardPhiNode and MemoryPhiNode
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16475
diff changeset
47 super(StampFactory.forVoid(), merge);
af52fd81a7a3 initializing constructors for GuardPhiNode and MemoryPhiNode
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16475
diff changeset
48 this.locationIdentity = locationIdentity;
af52fd81a7a3 initializing constructors for GuardPhiNode and MemoryPhiNode
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16475
diff changeset
49 this.values = new NodeInputList<>(this, values);
13152
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
50 }
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
51
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
52 public LocationIdentity getLocationIdentity() {
14978
e302df8bf51c separate subclasses for value and guard phis and proxies
Lukas Stadler <lukas.stadler@oracle.com>
parents: 13153
diff changeset
53 return locationIdentity;
13152
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
54 }
13153
ae0001b445c0 Common base interface for nodes in the memory graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 13152
diff changeset
55
14978
e302df8bf51c separate subclasses for value and guard phis and proxies
Lukas Stadler <lukas.stadler@oracle.com>
parents: 13153
diff changeset
56 @Override
e302df8bf51c separate subclasses for value and guard phis and proxies
Lukas Stadler <lukas.stadler@oracle.com>
parents: 13153
diff changeset
57 public NodeInputList<ValueNode> values() {
e302df8bf51c separate subclasses for value and guard phis and proxies
Lukas Stadler <lukas.stadler@oracle.com>
parents: 13153
diff changeset
58 return values;
e302df8bf51c separate subclasses for value and guard phis and proxies
Lukas Stadler <lukas.stadler@oracle.com>
parents: 13153
diff changeset
59 }
13152
640516a8ca6b Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
60 }