comparison graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/MemoryCheckpoint.java @ 10090:ae6f0c381087

split MemoryCheckpoint interface into Single and Multi
author Lukas Stadler <lukas.stadler@jku.at>
date Wed, 19 Jun 2013 16:42:56 +0200
parents 06dc2d2324d6
children ae0001b445c0
comparison
equal deleted inserted replaced
10089:97e8cabe9064 10090:ae6f0c381087
21 * questions. 21 * questions.
22 */ 22 */
23 package com.oracle.graal.nodes.extended; 23 package com.oracle.graal.nodes.extended;
24 24
25 import com.oracle.graal.api.meta.*; 25 import com.oracle.graal.api.meta.*;
26 import com.oracle.graal.graph.*;
26 import com.oracle.graal.nodes.*; 27 import com.oracle.graal.nodes.*;
27 28
28 /** 29 /**
29 * This interface marks subclasses of {@link FixedNode} that kill a set of memory locations 30 * This interface marks subclasses of {@link FixedNode} that kill a set of memory locations
30 * represented by location identities (i.e. change a value at one or more locations that belong to 31 * represented by location identities (i.e. change a value at one or more locations that belong to
31 * these location identities). 32 * these location identities).
32 */ 33 */
33 public interface MemoryCheckpoint { 34 public interface MemoryCheckpoint {
34 35
35 /** 36 interface Single extends MemoryCheckpoint {
36 * This method is used to determine which set of memory locations is killed by this node.
37 * Returning the special value {@link LocationIdentity#ANY_LOCATION} will kill all memory locations.
38 *
39 * @return the identities of all locations killed by this node.
40 */
41 LocationIdentity[] getLocationIdentities();
42 37
38 /**
39 * This method is used to determine which memory location is killed by this node. Returning
40 * the special value {@link LocationIdentity#ANY_LOCATION} will kill all memory locations.
41 *
42 * @return the identity of the location killed by this node.
43 */
44 LocationIdentity getLocationIdentity();
45
46 }
47
48 interface Multi extends MemoryCheckpoint {
49
50 /**
51 * This method is used to determine which set of memory locations is killed by this node.
52 * Returning the special value {@link LocationIdentity#ANY_LOCATION} will kill all memory
53 * locations.
54 *
55 * @return the identities of all locations killed by this node.
56 */
57 LocationIdentity[] getLocationIdentities();
58
59 }
60
61 public class TypeAssertion {
62
63 public static boolean correctType(Node node) {
64 return !(node instanceof MemoryCheckpoint) || (node instanceof MemoryCheckpoint.Single ^ node instanceof MemoryCheckpoint.Multi);
65 }
66 }
43 } 67 }