comparison graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/VirtualObjectNode.java @ 9501:bef43373de39

coalesce allocations during escape analysis
author Lukas Stadler <lukas.stadler@jku.at>
date Mon, 29 Apr 2013 14:53:08 +0200
parents fc972f34c1d5
children 106f0a0acafa
comparison
equal deleted inserted replaced
9500:9cc37ce426cc 9501:bef43373de39
20 * or visit www.oracle.com if you need additional information or have any 20 * or visit www.oracle.com if you need additional information or have any
21 * questions. 21 * questions.
22 */ 22 */
23 package com.oracle.graal.nodes.virtual; 23 package com.oracle.graal.nodes.virtual;
24 24
25 import java.util.*;
26
27 import com.oracle.graal.api.meta.*; 25 import com.oracle.graal.api.meta.*;
28 import com.oracle.graal.graph.*;
29 import com.oracle.graal.nodes.*; 26 import com.oracle.graal.nodes.*;
30 import com.oracle.graal.nodes.spi.*; 27 import com.oracle.graal.nodes.spi.*;
31 import com.oracle.graal.nodes.type.*; 28 import com.oracle.graal.nodes.type.*;
32 29
33 @NodeInfo(nameTemplate = "VirtualObject {p#type}")
34 public abstract class VirtualObjectNode extends ValueNode implements LIRLowerable { 30 public abstract class VirtualObjectNode extends ValueNode implements LIRLowerable {
35 31
36 public VirtualObjectNode() { 32 public VirtualObjectNode() {
37 super(StampFactory.virtual()); 33 super(StampFactory.virtual());
38 } 34 }
39 35
36 /**
37 * The type of object described by this {@link VirtualObjectNode}. In case of arrays, this is
38 * the array type (and not the component type).
39 */
40 public abstract ResolvedJavaType type(); 40 public abstract ResolvedJavaType type();
41 41
42 /**
43 * The number of entries this virtual object has. Either the number of fields or the number of
44 * array elements.
45 */
42 public abstract int entryCount(); 46 public abstract int entryCount();
47
48 /**
49 * Returns the name of the entry at the given index. Only used for debugging purposes.
50 */
51 public abstract String entryName(int i);
52
53 /**
54 * If the given index denotes an entry in this virtual object, the index of this entry is
55 * returned. If no such entry can be found, this method returns -1.
56 */
57 public abstract int entryIndexForOffset(long constantOffset);
58
59 /**
60 * Returns the {@link Kind} of the entry at the given index.
61 */
62 public abstract Kind entryKind(int index);
63
64 /**
65 * Returns an exact duplicate of this virtual object node, which has not been added to the graph
66 * yet.
67 */
68 public abstract VirtualObjectNode duplicate();
69
70 /**
71 * Specifies whether this virtual object has an object identity. If not, then the result of a
72 * comparison of two virtual objects is determined by comparing their contents.
73 */
74 public boolean hasIdentity() {
75 return true;
76 }
77
78 /**
79 * Returns a node that can be used to materialize this virtual object. If this returns an
80 * {@link AllocatedObjectNode} then this node will be attached to a {@link CommitAllocationNode}
81 * , otherwise the node will just be added to the graph.
82 */
83 public abstract ValueNode getMaterializedRepresentation(ValueNode[] entries, int lockCount);
43 84
44 @Override 85 @Override
45 public void generate(LIRGeneratorTool gen) { 86 public void generate(LIRGeneratorTool gen) {
46 // nothing to do... 87 // nothing to do...
47 } 88 }
48
49 public abstract String fieldName(int i);
50
51 public abstract void materializeAt(FixedWithNextNode materializeNode, List<ValueNode> values, boolean defaultValuesOnly, int lockCount);
52
53 public abstract int entryIndexForOffset(long constantOffset);
54
55 public abstract Kind entryKind(int index);
56
57 public abstract VirtualObjectNode duplicate();
58
59 public boolean hasIdentity() {
60 return true;
61 }
62 } 89 }