Mercurial > hg > graal-compiler
annotate graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/Value.java @ 21733:27943aac2e3c
Merge
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Thu, 04 Jun 2015 11:08:12 -0700 |
parents | e7f5ddef438d 26774dc3a5e7 |
children |
rev | line source |
---|---|
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1 /* |
16094
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
15453
diff
changeset
|
2 * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
4 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
8 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
14 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
18 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
21 * questions. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
22 */ |
21556
48c1ebd24120
renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
23 package com.oracle.jvmci.meta; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
24 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
25 /** |
18319
56cc1a799a60
(re)converted Value to an interface
Doug Simon <doug.simon@oracle.com>
parents:
18186
diff
changeset
|
26 * Interface for values manipulated by the compiler. All values have a {@linkplain Kind kind} and |
56cc1a799a60
(re)converted Value to an interface
Doug Simon <doug.simon@oracle.com>
parents:
18186
diff
changeset
|
27 * are immutable. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
28 */ |
18584
bf7db79a6e45
only TrustedInterfaces can be checked with VerifyUsageWithEquals
Doug Simon <doug.simon@oracle.com>
parents:
18319
diff
changeset
|
29 public interface Value extends KindProvider, TrustedInterface { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
30 |
21728
99fe8116f3e8
Make shared NO_VALUES array
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
21556
diff
changeset
|
31 Value[] NO_VALUES = new Value[0]; |
99fe8116f3e8
Make shared NO_VALUES array
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
21556
diff
changeset
|
32 |
21729
e7f5ddef438d
Make illegal value a nested class
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
21728
diff
changeset
|
33 AllocatableValue ILLEGAL = new IllegalValue(); |
e7f5ddef438d
Make illegal value a nested class
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
21728
diff
changeset
|
34 |
e7f5ddef438d
Make illegal value a nested class
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
21728
diff
changeset
|
35 public final class IllegalValue extends AllocatableValue { |
e7f5ddef438d
Make illegal value a nested class
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
21728
diff
changeset
|
36 private IllegalValue() { |
e7f5ddef438d
Make illegal value a nested class
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
21728
diff
changeset
|
37 super(LIRKind.Illegal); |
e7f5ddef438d
Make illegal value a nested class
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
21728
diff
changeset
|
38 } |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6477
diff
changeset
|
39 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
40 @Override |
4169
f5328dda9714
Initial commit of SSA-based spill-all register assignment
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4142
diff
changeset
|
41 public String toString() { |
f5328dda9714
Initial commit of SSA-based spill-all register assignment
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4142
diff
changeset
|
42 return "-"; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
43 } |
19699
50b6f616b3c7
Use ILLEGAL.equals(value) in ValueUtil.isIllegal
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18584
diff
changeset
|
44 |
50b6f616b3c7
Use ILLEGAL.equals(value) in ValueUtil.isIllegal
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18584
diff
changeset
|
45 @Override |
50b6f616b3c7
Use ILLEGAL.equals(value) in ValueUtil.isIllegal
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18584
diff
changeset
|
46 public boolean equals(Object other) { |
19752
edf663acfb3f
Do not rely on object identity when comparing Value.ILLEGAL
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
19699
diff
changeset
|
47 // Due to de-serialization this object may exist multiple times. So we compare classes |
edf663acfb3f
Do not rely on object identity when comparing Value.ILLEGAL
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
19699
diff
changeset
|
48 // instead of the individual objects. (This anonymous class has always the same meaning) |
21729
e7f5ddef438d
Make illegal value a nested class
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
21728
diff
changeset
|
49 return other instanceof IllegalValue; |
19699
50b6f616b3c7
Use ILLEGAL.equals(value) in ValueUtil.isIllegal
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18584
diff
changeset
|
50 } |
21729
e7f5ddef438d
Make illegal value a nested class
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
21728
diff
changeset
|
51 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
52 |
18319
56cc1a799a60
(re)converted Value to an interface
Doug Simon <doug.simon@oracle.com>
parents:
18186
diff
changeset
|
53 LIRKind getLIRKind(); |
16094
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
15453
diff
changeset
|
54 |
9422
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
9296
diff
changeset
|
55 /** |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
9296
diff
changeset
|
56 * Returns the platform specific kind used to store this value. |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
9296
diff
changeset
|
57 */ |
18319
56cc1a799a60
(re)converted Value to an interface
Doug Simon <doug.simon@oracle.com>
parents:
18186
diff
changeset
|
58 PlatformKind getPlatformKind(); |
16735
55c59139cc57
Add identityEquals to Value.
Josef Eisl <josef.eisl@jku.at>
parents:
16094
diff
changeset
|
59 |
55c59139cc57
Add identityEquals to Value.
Josef Eisl <josef.eisl@jku.at>
parents:
16094
diff
changeset
|
60 /** |
55c59139cc57
Add identityEquals to Value.
Josef Eisl <josef.eisl@jku.at>
parents:
16094
diff
changeset
|
61 * Checks if this value is identical to {@code other}. |
55c59139cc57
Add identityEquals to Value.
Josef Eisl <josef.eisl@jku.at>
parents:
16094
diff
changeset
|
62 * |
55c59139cc57
Add identityEquals to Value.
Josef Eisl <josef.eisl@jku.at>
parents:
16094
diff
changeset
|
63 * Warning: Use with caution! Usually equivalence {@link #equals(Object)} is sufficient and |
55c59139cc57
Add identityEquals to Value.
Josef Eisl <josef.eisl@jku.at>
parents:
16094
diff
changeset
|
64 * should be used. |
55c59139cc57
Add identityEquals to Value.
Josef Eisl <josef.eisl@jku.at>
parents:
16094
diff
changeset
|
65 */ |
18319
56cc1a799a60
(re)converted Value to an interface
Doug Simon <doug.simon@oracle.com>
parents:
18186
diff
changeset
|
66 default boolean identityEquals(Value other) { |
16735
55c59139cc57
Add identityEquals to Value.
Josef Eisl <josef.eisl@jku.at>
parents:
16094
diff
changeset
|
67 return this == other; |
55c59139cc57
Add identityEquals to Value.
Josef Eisl <josef.eisl@jku.at>
parents:
16094
diff
changeset
|
68 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
69 } |