annotate jvmci/jdk.vm.ci.meta/src/jdk/vm/ci/meta/PlatformKind.java @ 24225:a2dbb6fcc923

Added tag jvmci-0.33 for changeset 3aed4cb813f4
author Doug Simon <doug.simon@oracle.com>
date Fri, 18 Aug 2017 22:47:33 +0200
parents 1d4ce2d19e52
children
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 */
22672
1bbd4a7c274b Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22577
diff changeset
23 package jdk.vm.ci.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
18877
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
32 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
33
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
34 }
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
35
23297
4b58c92e939b remove redundant modifiers
Manuel Rigger <rigger.manuel@gmail.com>
parents: 22672
diff changeset
36 class EnumKey<E extends Enum<E>> implements Key {
22510
45723ab25426 Fix rawtypes warnings.
Roland Schatz <roland.schatz@oracle.com>
parents: 22054
diff changeset
37 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
38
22510
45723ab25426 Fix rawtypes warnings.
Roland Schatz <roland.schatz@oracle.com>
parents: 22054
diff changeset
39 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
40 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
41 }
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
42
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
43 @Override
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
44 public int hashCode() {
23393
1d4ce2d19e52 clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents: 23297
diff changeset
45 return e.ordinal();
18877
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
46 }
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
47
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
48 @Override
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
49 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
50 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
51 return true;
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
52 }
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 instanceof EnumKey) {
22510
45723ab25426 Fix rawtypes warnings.
Roland Schatz <roland.schatz@oracle.com>
parents: 22054
diff changeset
54 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
55 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
56 }
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
57 return false;
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 }
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 /**
18882
ceeaa3d58f1c removed invalid reference from javadoc
Doug Simon <doug.simon@oracle.com>
parents: 18877
diff changeset
62 * 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
63 * {@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
64 * executions.
18877
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
65 */
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
66 Key getKey();
d0f34a3055cf made AMD64HotSpotRegisterConfig.categorized stable across VM executions to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
67
22533
df053711614b Remove Value.getKind().
Roland Schatz <roland.schatz@oracle.com>
parents: 22510
diff changeset
68 /**
df053711614b Remove Value.getKind().
Roland Schatz <roland.schatz@oracle.com>
parents: 22510
diff changeset
69 * Get the size in bytes of this {@link PlatformKind}.
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 int getSizeInBytes();
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 /**
df053711614b Remove Value.getKind().
Roland Schatz <roland.schatz@oracle.com>
parents: 22510
diff changeset
74 * 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
75 * one, for SIMD types it may be higher.
df053711614b Remove Value.getKind().
Roland Schatz <roland.schatz@oracle.com>
parents: 22510
diff changeset
76 */
df053711614b Remove Value.getKind().
Roland Schatz <roland.schatz@oracle.com>
parents: 22510
diff changeset
77 int getVectorLength();
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 /**
df053711614b Remove Value.getKind().
Roland Schatz <roland.schatz@oracle.com>
parents: 22510
diff changeset
80 * 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
81 */
df053711614b Remove Value.getKind().
Roland Schatz <roland.schatz@oracle.com>
parents: 22510
diff changeset
82 char getTypeChar();
9422
149fe42411df Use platform specific kind in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
83 }