annotate graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java @ 19800:3362ba500371

Connect required Assumptions with answer to CHA query
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Wed, 11 Mar 2015 17:32:04 -0700
parents 17b5e453ab41
children deab43a789ad
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
1 /*
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18167
diff changeset
2 * Copyright (c) 2011, 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 */
5548
8872bc0eebdf Renaming hotspot.ri => hotspot.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5545
diff changeset
23 package com.oracle.graal.hotspot.meta;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
24
5507
dc71b06d09f8 Moving classes from cri.ri to api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5504
diff changeset
25 import com.oracle.graal.api.meta.*;
19800
3362ba500371 Connect required Assumptions with answer to CHA query
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18544
diff changeset
26 import com.oracle.graal.api.meta.Assumptions.AssumptionResult;
5466
af07e798947d lifted fast subtype check into checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents: 5326
diff changeset
27 import com.oracle.graal.hotspot.*;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
28
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
29 /**
5775
2c088af17e59 Removed left over Ri* prefixed identifiers
Doug Simon <doug.simon@oracle.com>
parents: 5760
diff changeset
30 * Implementation of {@link JavaType} for resolved non-primitive HotSpot classes.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
31 */
18223
17c98fad6980 converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18222
diff changeset
32 public interface HotSpotResolvedObjectType extends ResolvedJavaType {
18167
2bf5ea10eea7 sharpened return types for HotSpot specific Graal API implementations
Doug Simon <doug.simon@oracle.com>
parents: 17156
diff changeset
33
18223
17c98fad6980 converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18222
diff changeset
34 HotSpotResolvedObjectType getArrayClass();
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6699
diff changeset
35
18223
17c98fad6980 converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18222
diff changeset
36 ResolvedJavaType getComponentType();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
37
19800
3362ba500371 Connect required Assumptions with answer to CHA query
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18544
diff changeset
38 AssumptionResult<ResolvedJavaType> findUniqueConcreteSubtype();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
39
18223
17c98fad6980 converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18222
diff changeset
40 HotSpotResolvedObjectType getSuperclass();
13478
fe03864a2c72 replaced CompilerToVM.getUniqueImplementor with getKlassImplementor and moved the logic into Java
twisti
parents: 13375
diff changeset
41
18223
17c98fad6980 converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18222
diff changeset
42 HotSpotResolvedObjectType[] getInterfaces();
13478
fe03864a2c72 replaced CompilerToVM.getUniqueImplementor with getKlassImplementor and moved the logic into Java
twisti
parents: 13375
diff changeset
43
18223
17c98fad6980 converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18222
diff changeset
44 HotSpotResolvedObjectType getSupertype();
18182
e8c54fd622a4 Add ResolvedJavaType.getImplementor().
Josef Eisl <josef.eisl@jku.at>
parents: 18176
diff changeset
45
18223
17c98fad6980 converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18222
diff changeset
46 HotSpotResolvedObjectType findLeastCommonAncestor(ResolvedJavaType otherType);
7037
dd81042f4eb1 added unit tests for ResolvedJavaType
Doug Simon <doug.simon@oracle.com>
parents: 7030
diff changeset
47
18223
17c98fad6980 converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18222
diff changeset
48 HotSpotResolvedObjectType asExactType();
4635
f35c183f33ce fixed checkcast when inlining more than one method
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4484
diff changeset
49
18223
17c98fad6980 converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18222
diff changeset
50 default boolean isPrimitive() {
7059
e4d9f153934f removed ResolvedJavaType.toJava() and introduced ResolvedJavaType.isPrimitive()
Doug Simon <doug.simon@oracle.com>
parents: 7057
diff changeset
51 return false;
e4d9f153934f removed ResolvedJavaType.toJava() and introduced ResolvedJavaType.isPrimitive()
Doug Simon <doug.simon@oracle.com>
parents: 7057
diff changeset
52 }
e4d9f153934f removed ResolvedJavaType.toJava() and introduced ResolvedJavaType.isPrimitive()
Doug Simon <doug.simon@oracle.com>
parents: 7057
diff changeset
53
18223
17c98fad6980 converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18222
diff changeset
54 default Kind getKind() {
5540
a891c53a295b Renaming RiKind => Kind.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5538
diff changeset
55 return Kind.Object;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
56 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
57
18223
17c98fad6980 converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18222
diff changeset
58 ConstantPool constantPool();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
59
5616
310ed6650682 added check to ensure fast path allocation is never used for types that don't allow it
Doug Simon <doug.simon@oracle.com>
parents: 5554
diff changeset
60 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7359
diff changeset
61 * Gets the instance size of this type. If an instance of this type cannot be fast path
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7359
diff changeset
62 * allocated, then the returned value is negative (its absolute value gives the size). Must not
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7359
diff changeset
63 * be called if this is an array or interface type.
5616
310ed6650682 added check to ensure fast path allocation is never used for types that don't allow it
Doug Simon <doug.simon@oracle.com>
parents: 5554
diff changeset
64 */
18223
17c98fad6980 converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18222
diff changeset
65 int instanceSize();
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6699
diff changeset
66
18223
17c98fad6980 converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18222
diff changeset
67 int getVtableLength();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
68
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
69 @Override
19800
3362ba500371 Connect required Assumptions with answer to CHA query
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18544
diff changeset
70 AssumptionResult<ResolvedJavaMethod> findUniqueConcreteMethod(ResolvedJavaMethod method);
4484
14a00ee82980 Implement eager type resolving.
Andreas Woess <andreas.woess@jku.at>
parents: 4433
diff changeset
71
16492
8853b9304083 made type resolution require an accessing class context
Doug Simon <doug.simon@oracle.com>
parents: 16491
diff changeset
72 /**
16575
adafceb4da4a improved name and documentation for method implementing fast-path check for type resolution
Doug Simon <doug.simon@oracle.com>
parents: 16492
diff changeset
73 * Performs a fast-path check that this type is resolved in the context of a given accessing
adafceb4da4a improved name and documentation for method implementing fast-path check for type resolution
Doug Simon <doug.simon@oracle.com>
parents: 16492
diff changeset
74 * class. A negative result does not mean this type is not resolved with respect to
adafceb4da4a improved name and documentation for method implementing fast-path check for type resolution
Doug Simon <doug.simon@oracle.com>
parents: 16492
diff changeset
75 * {@code accessingClass}. That can only be determined by
adafceb4da4a improved name and documentation for method implementing fast-path check for type resolution
Doug Simon <doug.simon@oracle.com>
parents: 16492
diff changeset
76 * {@linkplain HotSpotGraalRuntime#lookupType(String, HotSpotResolvedObjectType, boolean)
adafceb4da4a improved name and documentation for method implementing fast-path check for type resolution
Doug Simon <doug.simon@oracle.com>
parents: 16492
diff changeset
77 * re-resolving} the type.
16492
8853b9304083 made type resolution require an accessing class context
Doug Simon <doug.simon@oracle.com>
parents: 16491
diff changeset
78 */
18223
17c98fad6980 converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18222
diff changeset
79 boolean isDefinitelyResolvedWithRespectTo(ResolvedJavaType accessingClass);
5326
a53162ca8219 introduced HotSpotKlassOop type to convey a klassOop value from the compiler to the C++ code instead of relying on the C++ code automagically converting a HotSpotTypeResolvedImpl value to a klassOop
Doug Simon <doug.simon@oracle.com>
parents: 5287
diff changeset
80
7037
dd81042f4eb1 added unit tests for ResolvedJavaType
Doug Simon <doug.simon@oracle.com>
parents: 7030
diff changeset
81 /**
18187
9619ba4daf4c Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents: 18182
diff changeset
82 * Gets the metaspace Klass boxed in a {@link JavaConstant}.
7037
dd81042f4eb1 added unit tests for ResolvedJavaType
Doug Simon <doug.simon@oracle.com>
parents: 7030
diff changeset
83 */
18362
ea0fbb571466 Use pointer stamps in LoadHub and LoadMethod.
Roland Schatz <roland.schatz@oracle.com>
parents: 18223
diff changeset
84 Constant klass();
7049
ccade022ec83 virtualization of unsafeload and unsafestore
Lukas Stadler <lukas.stadler@jku.at>
parents: 7037
diff changeset
85
18223
17c98fad6980 converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18222
diff changeset
86 boolean isPrimaryType();
7819
aa022eaf1569 class file path retrieval
Michael Haupt <michael.haupt@oracle.com>
parents: 7530
diff changeset
87
18223
17c98fad6980 converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18222
diff changeset
88 int superCheckOffset();
7829
a44887443b0c support for inner classes (local/member) in meta API
Michael Haupt <michael.haupt@oracle.com>
parents: 7828
diff changeset
89
18223
17c98fad6980 converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18222
diff changeset
90 long prototypeMarkWord();
9100
d24955427b0b Remove MetaUtil.getMirrorOrFail; Add necessary functionality to the Graal API so that all previous usages of java.lang.Class can now use ResolvedJavaType
Christian Wimmer <christian.wimmer@oracle.com>
parents: 8959
diff changeset
91
18223
17c98fad6980 converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18222
diff changeset
92 HotSpotResolvedObjectType getEnclosingType();
9100
d24955427b0b Remove MetaUtil.getMirrorOrFail; Add necessary functionality to the Graal API so that all previous usages of java.lang.Class can now use ResolvedJavaType
Christian Wimmer <christian.wimmer@oracle.com>
parents: 8959
diff changeset
93
18223
17c98fad6980 converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18222
diff changeset
94 ResolvedJavaMethod getClassInitializer();
18544
17b5e453ab41 replaced concrete types with interface types to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18362
diff changeset
95
17b5e453ab41 replaced concrete types with interface types to support replay compilation
Doug Simon <doug.simon@oracle.com>
parents: 18362
diff changeset
96 ResolvedJavaField createField(String name, JavaType type, long offset, int modifiers);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
97 }