Mercurial > hg > truffle
annotate graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/MemoryPhiNode.java @ 14978:e302df8bf51c
separate subclasses for value and guard phis and proxies
author | Lukas Stadler <lukas.stadler@oracle.com> |
---|---|
date | Fri, 04 Apr 2014 18:32:32 +0200 |
parents | ae0001b445c0 |
children | 27c04ee36dcb |
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.*; |
14978
e302df8bf51c
separate subclasses for value and guard phis and proxies
Lukas Stadler <lukas.stadler@oracle.com>
parents:
13153
diff
changeset
|
26 import com.oracle.graal.graph.*; |
13153
ae0001b445c0
Common base interface for nodes in the memory graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
13152
diff
changeset
|
27 import com.oracle.graal.nodes.extended.*; |
14978
e302df8bf51c
separate subclasses for value and guard phis and proxies
Lukas Stadler <lukas.stadler@oracle.com>
parents:
13153
diff
changeset
|
28 import com.oracle.graal.nodes.type.*; |
13152
640516a8ca6b
Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
29 |
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 * The {@code PhiNode} represents the merging of dataflow in the memory graph. |
640516a8ca6b
Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
32 */ |
13153
ae0001b445c0
Common base interface for nodes in the memory graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
13152
diff
changeset
|
33 public class MemoryPhiNode extends PhiNode implements MemoryNode { |
13152
640516a8ca6b
Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
34 |
14978
e302df8bf51c
separate subclasses for value and guard phis and proxies
Lukas Stadler <lukas.stadler@oracle.com>
parents:
13153
diff
changeset
|
35 @Input final NodeInputList<ValueNode> values = new NodeInputList<>(this); |
e302df8bf51c
separate subclasses for value and guard phis and proxies
Lukas Stadler <lukas.stadler@oracle.com>
parents:
13153
diff
changeset
|
36 private final LocationIdentity locationIdentity; |
13152
640516a8ca6b
Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
37 |
14978
e302df8bf51c
separate subclasses for value and guard phis and proxies
Lukas Stadler <lukas.stadler@oracle.com>
parents:
13153
diff
changeset
|
38 public MemoryPhiNode(MergeNode merge, LocationIdentity locationIdentity) { |
e302df8bf51c
separate subclasses for value and guard phis and proxies
Lukas Stadler <lukas.stadler@oracle.com>
parents:
13153
diff
changeset
|
39 super(StampFactory.dependency(), merge); |
e302df8bf51c
separate subclasses for value and guard phis and proxies
Lukas Stadler <lukas.stadler@oracle.com>
parents:
13153
diff
changeset
|
40 this.locationIdentity = locationIdentity; |
13152
640516a8ca6b
Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
41 } |
640516a8ca6b
Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
42 |
640516a8ca6b
Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
43 public LocationIdentity getLocationIdentity() { |
14978
e302df8bf51c
separate subclasses for value and guard phis and proxies
Lukas Stadler <lukas.stadler@oracle.com>
parents:
13153
diff
changeset
|
44 return locationIdentity; |
13152
640516a8ca6b
Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
45 } |
13153
ae0001b445c0
Common base interface for nodes in the memory graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
13152
diff
changeset
|
46 |
ae0001b445c0
Common base interface for nodes in the memory graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
13152
diff
changeset
|
47 public MemoryCheckpoint asMemoryCheckpoint() { |
ae0001b445c0
Common base interface for nodes in the memory graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
13152
diff
changeset
|
48 return null; |
ae0001b445c0
Common base interface for nodes in the memory graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
13152
diff
changeset
|
49 } |
ae0001b445c0
Common base interface for nodes in the memory graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
13152
diff
changeset
|
50 |
ae0001b445c0
Common base interface for nodes in the memory graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
13152
diff
changeset
|
51 public MemoryPhiNode asMemoryPhi() { |
ae0001b445c0
Common base interface for nodes in the memory graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
13152
diff
changeset
|
52 return this; |
ae0001b445c0
Common base interface for nodes in the memory graph.
Roland Schatz <roland.schatz@oracle.com>
parents:
13152
diff
changeset
|
53 } |
14978
e302df8bf51c
separate subclasses for value and guard phis and proxies
Lukas Stadler <lukas.stadler@oracle.com>
parents:
13153
diff
changeset
|
54 |
e302df8bf51c
separate subclasses for value and guard phis and proxies
Lukas Stadler <lukas.stadler@oracle.com>
parents:
13153
diff
changeset
|
55 @Override |
e302df8bf51c
separate subclasses for value and guard phis and proxies
Lukas Stadler <lukas.stadler@oracle.com>
parents:
13153
diff
changeset
|
56 public NodeInputList<ValueNode> values() { |
e302df8bf51c
separate subclasses for value and guard phis and proxies
Lukas Stadler <lukas.stadler@oracle.com>
parents:
13153
diff
changeset
|
57 return values; |
e302df8bf51c
separate subclasses for value and guard phis and proxies
Lukas Stadler <lukas.stadler@oracle.com>
parents:
13153
diff
changeset
|
58 } |
13152
640516a8ca6b
Separate class for MemoryProxy and MemoryPhi.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
59 } |