Mercurial > hg > graal-compiler
annotate graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/PlatformKind.java @ 21623:d2113f5ae550
Merge.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sun, 31 May 2015 23:58:09 +0200 |
parents | 48c1ebd24120 |
children |
rev | line source |
---|---|
9422
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
1 /* |
16094
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
16012
diff
changeset
|
2 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. |
9422
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
4 * |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
8 * |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
14 * |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
18 * |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
21 * questions. |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@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:
18882
diff
changeset
|
23 package com.oracle.jvmci.meta; |
9422
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
24 |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
25 /** |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
26 * Represents a platform-specific low-level type for values. |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
27 */ |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
28 public interface PlatformKind { |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
29 |
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
30 String name(); |
16012
0497ead7ec50
Support null check directly on compressed oops.
Roland Schatz <roland.schatz@oracle.com>
parents:
9422
diff
changeset
|
31 |
18187
9619ba4daf4c
Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents:
16094
diff
changeset
|
32 JavaConstant getDefaultValue(); |
16094
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
16012
diff
changeset
|
33 |
18877
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
34 public interface Key { |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
35 |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
36 } |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
37 |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
38 public class EnumKey implements Key { |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
39 @SuppressWarnings("rawtypes") private final Enum e; |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
40 |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
41 @SuppressWarnings("rawtypes") |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
42 public EnumKey(Enum e) { |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
43 this.e = e; |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
44 } |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
45 |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
46 @Override |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
47 public int hashCode() { |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
48 return e.ordinal() ^ e.name().hashCode(); |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
49 } |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
50 |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
51 @Override |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
52 public boolean equals(Object obj) { |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
53 if (obj == this) { |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
54 return true; |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
55 } |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
56 if (obj instanceof EnumKey) { |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
57 EnumKey that = (EnumKey) obj; |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
58 return this.e == that.e; |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
59 } |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
60 return false; |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
61 } |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
62 } |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
63 |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
64 /** |
18882
ceeaa3d58f1c
removed invalid reference from javadoc
Doug Simon <doug.simon@oracle.com>
parents:
18877
diff
changeset
|
65 * Gets a value associated with this object that can be used as a stable key in a map. The |
ceeaa3d58f1c
removed invalid reference from javadoc
Doug Simon <doug.simon@oracle.com>
parents:
18877
diff
changeset
|
66 * {@link Object#hashCode()} implementation of the returned value should be stable between VM |
ceeaa3d58f1c
removed invalid reference from javadoc
Doug Simon <doug.simon@oracle.com>
parents:
18877
diff
changeset
|
67 * executions. |
18877
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
68 */ |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
69 Key getKey(); |
d0f34a3055cf
made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
70 |
16094
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
16012
diff
changeset
|
71 default int getVectorLength() { |
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
16012
diff
changeset
|
72 return 1; |
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
16012
diff
changeset
|
73 } |
9422
149fe42411df
Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff
changeset
|
74 } |