annotate graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/MemoryMapNode.java @ 17276:ffb974bef674

moved Node valueNumber and valueEquals logic (optionally) to generated nodes
author Doug Simon <doug.simon@oracle.com>
date Wed, 01 Oct 2014 07:39:47 +0200
parents 0fe4732e5181
children 655f3e6b467b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16233
68fb8e4d8043 added missed copyright header
Doug Simon <doug.simon@oracle.com>
parents: 16230
diff changeset
1 /*
68fb8e4d8043 added missed copyright header
Doug Simon <doug.simon@oracle.com>
parents: 16230
diff changeset
2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
68fb8e4d8043 added missed copyright header
Doug Simon <doug.simon@oracle.com>
parents: 16230
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
68fb8e4d8043 added missed copyright header
Doug Simon <doug.simon@oracle.com>
parents: 16230
diff changeset
4 *
68fb8e4d8043 added missed copyright header
Doug Simon <doug.simon@oracle.com>
parents: 16230
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
68fb8e4d8043 added missed copyright header
Doug Simon <doug.simon@oracle.com>
parents: 16230
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
68fb8e4d8043 added missed copyright header
Doug Simon <doug.simon@oracle.com>
parents: 16230
diff changeset
7 * published by the Free Software Foundation.
68fb8e4d8043 added missed copyright header
Doug Simon <doug.simon@oracle.com>
parents: 16230
diff changeset
8 *
68fb8e4d8043 added missed copyright header
Doug Simon <doug.simon@oracle.com>
parents: 16230
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
68fb8e4d8043 added missed copyright header
Doug Simon <doug.simon@oracle.com>
parents: 16230
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
68fb8e4d8043 added missed copyright header
Doug Simon <doug.simon@oracle.com>
parents: 16230
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
68fb8e4d8043 added missed copyright header
Doug Simon <doug.simon@oracle.com>
parents: 16230
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
68fb8e4d8043 added missed copyright header
Doug Simon <doug.simon@oracle.com>
parents: 16230
diff changeset
13 * accompanied this code).
68fb8e4d8043 added missed copyright header
Doug Simon <doug.simon@oracle.com>
parents: 16230
diff changeset
14 *
68fb8e4d8043 added missed copyright header
Doug Simon <doug.simon@oracle.com>
parents: 16230
diff changeset
15 * You should have received a copy of the GNU General Public License version
68fb8e4d8043 added missed copyright header
Doug Simon <doug.simon@oracle.com>
parents: 16230
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
68fb8e4d8043 added missed copyright header
Doug Simon <doug.simon@oracle.com>
parents: 16230
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
68fb8e4d8043 added missed copyright header
Doug Simon <doug.simon@oracle.com>
parents: 16230
diff changeset
18 *
68fb8e4d8043 added missed copyright header
Doug Simon <doug.simon@oracle.com>
parents: 16230
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
68fb8e4d8043 added missed copyright header
Doug Simon <doug.simon@oracle.com>
parents: 16230
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
68fb8e4d8043 added missed copyright header
Doug Simon <doug.simon@oracle.com>
parents: 16230
diff changeset
21 * questions.
68fb8e4d8043 added missed copyright header
Doug Simon <doug.simon@oracle.com>
parents: 16230
diff changeset
22 */
16230
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
23 package com.oracle.graal.nodes;
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
24
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
25 import static com.oracle.graal.api.meta.LocationIdentity.*;
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
26
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
27 import java.util.*;
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
28
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
29 import com.oracle.graal.api.meta.*;
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
30 import com.oracle.graal.compiler.common.type.*;
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
31 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: 16327
diff changeset
32 import com.oracle.graal.nodeinfo.*;
16230
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
33 import com.oracle.graal.nodes.calc.*;
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
34 import com.oracle.graal.nodes.extended.*;
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
35 import com.oracle.graal.nodes.spi.*;
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
36
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
37 @NodeInfo(allowedUsageTypes = {InputType.Extension})
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
38 public class MemoryMapNode extends FloatingNode implements MemoryMap, LIRLowerable {
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
39
17276
ffb974bef674 moved Node valueNumber and valueEquals logic (optionally) to generated nodes
Doug Simon <doug.simon@oracle.com>
parents: 16919
diff changeset
40 protected final List<LocationIdentity> locationIdentities;
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
41 @Input(InputType.Memory) NodeInputList<ValueNode> nodes;
16230
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
42
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
43 private boolean checkOrder(Map<LocationIdentity, MemoryNode> mmap) {
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
44 for (int i = 0; i < locationIdentities.size(); i++) {
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
45 LocationIdentity locationIdentity = locationIdentities.get(i);
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
46 ValueNode n = nodes.get(i);
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
47 assertTrue(mmap.get(locationIdentity) == n, "iteration order of keys differs from values in input map");
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
48 }
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
49 return true;
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
50 }
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
51
16895
06c15e88d383 added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
Doug Simon <doug.simon@oracle.com>
parents: 16841
diff changeset
52 public static MemoryMapNode create(Map<LocationIdentity, MemoryNode> mmap) {
16919
0fe4732e5181 made use of generated Node classes predicated on value of graal.useGeneratedNodes system property (default is false)
Doug Simon <doug.simon@oracle.com>
parents: 16897
diff changeset
53 return USE_GENERATED_NODES ? new MemoryMapNodeGen(mmap) : new MemoryMapNode(mmap);
16895
06c15e88d383 added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
Doug Simon <doug.simon@oracle.com>
parents: 16841
diff changeset
54 }
06c15e88d383 added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
Doug Simon <doug.simon@oracle.com>
parents: 16841
diff changeset
55
06c15e88d383 added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
Doug Simon <doug.simon@oracle.com>
parents: 16841
diff changeset
56 protected MemoryMapNode(Map<LocationIdentity, MemoryNode> mmap) {
16230
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
57 super(StampFactory.forVoid());
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
58 locationIdentities = new ArrayList<>(mmap.keySet());
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
59 nodes = new NodeInputList<>(this, mmap.values());
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
60 assert checkOrder(mmap);
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
61 }
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
62
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
63 public boolean isEmpty() {
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
64 if (locationIdentities.isEmpty()) {
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
65 return true;
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
66 }
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
67 if (locationIdentities.size() == 1) {
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
68 if (nodes.get(0) instanceof StartNode) {
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
69 return true;
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
70 }
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
71 }
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
72 return false;
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
73 }
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
74
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
75 public MemoryNode getLastLocationAccess(LocationIdentity locationIdentity) {
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
76 if (locationIdentity == FINAL_LOCATION) {
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
77 return null;
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
78 } else {
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
79 int index = locationIdentities.indexOf(locationIdentity);
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
80 if (index == -1) {
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
81 index = locationIdentities.indexOf(ANY_LOCATION);
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
82 }
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
83 assert index != -1;
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
84 return (MemoryNode) nodes.get(index);
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
85 }
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
86 }
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
87
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
88 public Collection<LocationIdentity> getLocations() {
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
89 return locationIdentities;
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
90 }
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
91
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
92 public Map<LocationIdentity, MemoryNode> toMap() {
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
93 HashMap<LocationIdentity, MemoryNode> res = new HashMap<>(locationIdentities.size());
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
94 for (int i = 0; i < nodes.size(); i++) {
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
95 res.put(locationIdentities.get(i), (MemoryNode) nodes.get(i));
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
96 }
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
97 return res;
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
98 }
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
99
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
100 public void generate(NodeLIRBuilderTool generator) {
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
101 // nothing to do...
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
102 }
5f72421928e0 converted MemoryMap to an interface and provided new MemoryMapNode implementation that is also a Node allowing the map and it's node entries to survive DeadCodeElimination by normal graph reachability rules
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
103 }