annotate jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/PlatformKind.java @ 22533:df053711614b

Remove Value.getKind().
author Roland Schatz <roland.schatz@oracle.com>
date Tue, 08 Sep 2015 14:13:38 +0200
parents 45723ab25426
children c10d5fb9776b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9422
149fe42411df Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
1 /*
22533
df053711614b Remove Value.getKind().
Roland Schatz <roland.schatz@oracle.com>
parents: 22510
diff changeset
2 * Copyright (c) 2013, 2015, 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 */
22054
0e095e2c24e2 Rename com.oracle.jvmci to jdk.internal.jvmci
twisti
parents: 21798
diff changeset
23 package jdk.internal.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
22510
45723ab25426 Fix rawtypes warnings.
Roland Schatz <roland.schatz@oracle.com>
parents: 22054
diff changeset
38 public class EnumKey<E extends Enum<E>> implements Key {
45723ab25426 Fix rawtypes warnings.
Roland Schatz <roland.schatz@oracle.com>
parents: 22054
diff changeset
39 private final Enum<E> e;
18877
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
40
22510
45723ab25426 Fix rawtypes warnings.
Roland Schatz <roland.schatz@oracle.com>
parents: 22054
diff changeset
41 public EnumKey(Enum<E> e) {
18877
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
42 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
43 }
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 @Override
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
46 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
47 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
48 }
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 @Override
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
51 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
52 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
53 return true;
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
54 }
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
55 if (obj instanceof EnumKey) {
22510
45723ab25426 Fix rawtypes warnings.
Roland Schatz <roland.schatz@oracle.com>
parents: 22054
diff changeset
56 EnumKey<?> that = (EnumKey<?>) obj;
18877
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
57 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
58 }
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
59 return false;
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
60 }
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 /**
18882
ceeaa3d58f1c removed invalid reference from javadoc
Doug Simon <doug.simon@oracle.com>
parents: 18877
diff changeset
64 * 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
65 * {@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
66 * executions.
18877
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
67 */
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
68 Key getKey();
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
69
22533
df053711614b Remove Value.getKind().
Roland Schatz <roland.schatz@oracle.com>
parents: 22510
diff changeset
70 /**
df053711614b Remove Value.getKind().
Roland Schatz <roland.schatz@oracle.com>
parents: 22510
diff changeset
71 * Get the size in bytes of this {@link PlatformKind}.
df053711614b Remove Value.getKind().
Roland Schatz <roland.schatz@oracle.com>
parents: 22510
diff changeset
72 */
df053711614b Remove Value.getKind().
Roland Schatz <roland.schatz@oracle.com>
parents: 22510
diff changeset
73 int getSizeInBytes();
df053711614b Remove Value.getKind().
Roland Schatz <roland.schatz@oracle.com>
parents: 22510
diff changeset
74
df053711614b Remove Value.getKind().
Roland Schatz <roland.schatz@oracle.com>
parents: 22510
diff changeset
75 /**
df053711614b Remove Value.getKind().
Roland Schatz <roland.schatz@oracle.com>
parents: 22510
diff changeset
76 * Returns how many primitive values fit in this {@link PlatformKind}. For scalar types this is
df053711614b Remove Value.getKind().
Roland Schatz <roland.schatz@oracle.com>
parents: 22510
diff changeset
77 * one, for SIMD types it may be higher.
df053711614b Remove Value.getKind().
Roland Schatz <roland.schatz@oracle.com>
parents: 22510
diff changeset
78 */
df053711614b Remove Value.getKind().
Roland Schatz <roland.schatz@oracle.com>
parents: 22510
diff changeset
79 int getVectorLength();
df053711614b Remove Value.getKind().
Roland Schatz <roland.schatz@oracle.com>
parents: 22510
diff changeset
80
df053711614b Remove Value.getKind().
Roland Schatz <roland.schatz@oracle.com>
parents: 22510
diff changeset
81 /**
df053711614b Remove Value.getKind().
Roland Schatz <roland.schatz@oracle.com>
parents: 22510
diff changeset
82 * Gets a single type char that identifies this type for use in debug output.
df053711614b Remove Value.getKind().
Roland Schatz <roland.schatz@oracle.com>
parents: 22510
diff changeset
83 */
df053711614b Remove Value.getKind().
Roland Schatz <roland.schatz@oracle.com>
parents: 22510
diff changeset
84 char getTypeChar();
9422
149fe42411df Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
85 }