Mercurial > hg > truffle
comparison graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiAddress.java @ 5506:56860d3f9f39
More refactorings and renamings in preparation of ci/ri split.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Thu, 07 Jun 2012 18:12:01 +0200 |
parents | 452f91ebdb54 |
children | dc71b06d09f8 |
comparison
equal
deleted
inserted
replaced
5505:28af6dff047f | 5506:56860d3f9f39 |
---|---|
29 /** | 29 /** |
30 * Represents an address in target machine memory, specified via some combination of a base register, an index register, | 30 * Represents an address in target machine memory, specified via some combination of a base register, an index register, |
31 * a displacement and a scale. Note that the base and index registers may be a variable that will get a register assigned | 31 * a displacement and a scale. Note that the base and index registers may be a variable that will get a register assigned |
32 * later by the register allocator. | 32 * later by the register allocator. |
33 */ | 33 */ |
34 public final class CiAddress extends CiValue { | 34 public final class CiAddress extends RiValue { |
35 private static final long serialVersionUID = -1003772042519945089L; | 35 private static final long serialVersionUID = -1003772042519945089L; |
36 | 36 |
37 /** | 37 /** |
38 * A sentinel value used as a place holder in an instruction stream for an address that will be patched. | 38 * A sentinel value used as a place holder in an instruction stream for an address that will be patched. |
39 */ | 39 */ |
40 public static final CiAddress Placeholder = new CiAddress(RiKind.Illegal, CiValue.IllegalValue); | 40 public static final CiAddress Placeholder = new CiAddress(RiKind.Illegal, RiValue.IllegalValue); |
41 | 41 |
42 /** | 42 /** |
43 * Base register that defines the start of the address computation. | 43 * Base register that defines the start of the address computation. |
44 * If not present, is denoted by {@link CiValue#IllegalValue}. | 44 * If not present, is denoted by {@link RiValue#IllegalValue}. |
45 */ | 45 */ |
46 public CiValue base; | 46 public RiValue base; |
47 | 47 |
48 /** | 48 /** |
49 * Index register, the value of which (possibly scaled by {@link #scale}) is added to {@link #base}. | 49 * Index register, the value of which (possibly scaled by {@link #scale}) is added to {@link #base}. |
50 * If not present, is denoted by {@link CiValue#IllegalValue}. | 50 * If not present, is denoted by {@link RiValue#IllegalValue}. |
51 */ | 51 */ |
52 public CiValue index; | 52 public RiValue index; |
53 | 53 |
54 /** | 54 /** |
55 * Scaling factor for indexing, dependent on target operand size. | 55 * Scaling factor for indexing, dependent on target operand size. |
56 */ | 56 */ |
57 public final Scale scale; | 57 public final Scale scale; |
64 /** | 64 /** |
65 * Creates a {@code CiAddress} with given base register, no scaling and no displacement. | 65 * Creates a {@code CiAddress} with given base register, no scaling and no displacement. |
66 * @param kind the kind of the value being addressed | 66 * @param kind the kind of the value being addressed |
67 * @param base the base register | 67 * @param base the base register |
68 */ | 68 */ |
69 public CiAddress(RiKind kind, CiValue base) { | 69 public CiAddress(RiKind kind, RiValue base) { |
70 this(kind, base, IllegalValue, Scale.Times1, 0); | 70 this(kind, base, IllegalValue, Scale.Times1, 0); |
71 } | 71 } |
72 | 72 |
73 /** | 73 /** |
74 * Creates a {@code CiAddress} with given base register, no scaling and a given displacement. | 74 * Creates a {@code CiAddress} with given base register, no scaling and a given displacement. |
75 * @param kind the kind of the value being addressed | 75 * @param kind the kind of the value being addressed |
76 * @param base the base register | 76 * @param base the base register |
77 * @param displacement the displacement | 77 * @param displacement the displacement |
78 */ | 78 */ |
79 public CiAddress(RiKind kind, CiValue base, int displacement) { | 79 public CiAddress(RiKind kind, RiValue base, int displacement) { |
80 this(kind, base, IllegalValue, Scale.Times1, displacement); | 80 this(kind, base, IllegalValue, Scale.Times1, displacement); |
81 } | 81 } |
82 | 82 |
83 /** | 83 /** |
84 * Creates a {@code CiAddress} with given base and index registers, scaling and displacement. | 84 * Creates a {@code CiAddress} with given base and index registers, scaling and displacement. |
87 * @param base the base register | 87 * @param base the base register |
88 * @param index the index register | 88 * @param index the index register |
89 * @param scale the scaling factor | 89 * @param scale the scaling factor |
90 * @param displacement the displacement | 90 * @param displacement the displacement |
91 */ | 91 */ |
92 public CiAddress(RiKind kind, CiValue base, CiValue index, Scale scale, int displacement) { | 92 public CiAddress(RiKind kind, RiValue base, RiValue index, Scale scale, int displacement) { |
93 super(kind); | 93 super(kind); |
94 this.base = base; | 94 this.base = base; |
95 this.index = index; | 95 this.index = index; |
96 this.scale = scale; | 96 this.scale = scale; |
97 this.displacement = displacement; | 97 this.displacement = displacement; |