annotate graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/jvmci/HotSpotResolvedJavaMethod.java @ 21532:ee764a50af61

require @ServiceProcessor annotated classes to be top level types
author Doug Simon <doug.simon@oracle.com>
date Sun, 24 May 2015 14:42:38 +0200
parents 1da7aef31a08
children
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 /*
14717
aa1a43bfdf4e make HotSpotResolvedJavaMethod leaner
twisti
parents: 14607
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 */
21526
1da7aef31a08 created com.oracle.graal.hotspot.jvmci package and moved classes destined for future JVMCI module into it (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 18323
diff changeset
23 package com.oracle.graal.hotspot.jvmci;
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 import java.lang.reflect.*;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
26
8217
dce9cefed571 Draft speculation log.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7930
diff changeset
27 import com.oracle.graal.api.code.*;
5507
dc71b06d09f8 Moving classes from cri.ri to api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5346
diff changeset
28 import com.oracle.graal.api.meta.*;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
29
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
30 /**
5775
2c088af17e59 Removed left over Ri* prefixed identifiers
Doug Simon <doug.simon@oracle.com>
parents: 5722
diff changeset
31 * Implementation of {@link JavaMethod} for resolved HotSpot methods.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
32 */
18222
a8cff27ca2e1 converted HotSpotResolvedJavaMethod to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
33 public interface HotSpotResolvedJavaMethod extends ResolvedJavaMethod {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
34
9416
16c354398d09 intrinsify Reflection.getCallerClass
twisti
parents: 9380
diff changeset
35 /**
14717
aa1a43bfdf4e make HotSpotResolvedJavaMethod leaner
twisti
parents: 14607
diff changeset
36 * Returns true if this method has a {@code CallerSensitive} annotation.
15018
db4254246f9a Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents: 14717
diff changeset
37 *
9416
16c354398d09 intrinsify Reflection.getCallerClass
twisti
parents: 9380
diff changeset
38 * @return true if CallerSensitive annotation present, false otherwise
16c354398d09 intrinsify Reflection.getCallerClass
twisti
parents: 9380
diff changeset
39 */
18222
a8cff27ca2e1 converted HotSpotResolvedJavaMethod to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
40 boolean isCallerSensitive();
a8cff27ca2e1 converted HotSpotResolvedJavaMethod to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
41
18323
301c5e3d683a removed *Impl types in signatures of Remote interfaces
Doug Simon <doug.simon@oracle.com>
parents: 18223
diff changeset
42 HotSpotResolvedObjectType getDeclaringClass();
14717
aa1a43bfdf4e make HotSpotResolvedJavaMethod leaner
twisti
parents: 14607
diff changeset
43
aa1a43bfdf4e make HotSpotResolvedJavaMethod leaner
twisti
parents: 14607
diff changeset
44 /**
aa1a43bfdf4e make HotSpotResolvedJavaMethod leaner
twisti
parents: 14607
diff changeset
45 * Returns true if this method has a {@code ForceInline} annotation.
15018
db4254246f9a Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents: 14717
diff changeset
46 *
14717
aa1a43bfdf4e make HotSpotResolvedJavaMethod leaner
twisti
parents: 14607
diff changeset
47 * @return true if ForceInline annotation present, false otherwise
aa1a43bfdf4e make HotSpotResolvedJavaMethod leaner
twisti
parents: 14607
diff changeset
48 */
18222
a8cff27ca2e1 converted HotSpotResolvedJavaMethod to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
49 boolean isForceInline();
14717
aa1a43bfdf4e make HotSpotResolvedJavaMethod leaner
twisti
parents: 14607
diff changeset
50
aa1a43bfdf4e make HotSpotResolvedJavaMethod leaner
twisti
parents: 14607
diff changeset
51 /**
aa1a43bfdf4e make HotSpotResolvedJavaMethod leaner
twisti
parents: 14607
diff changeset
52 * Returns true if this method has a {@code DontInline} annotation.
15018
db4254246f9a Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents: 14717
diff changeset
53 *
14717
aa1a43bfdf4e make HotSpotResolvedJavaMethod leaner
twisti
parents: 14607
diff changeset
54 * @return true if DontInline annotation present, false otherwise
aa1a43bfdf4e make HotSpotResolvedJavaMethod leaner
twisti
parents: 14607
diff changeset
55 */
18222
a8cff27ca2e1 converted HotSpotResolvedJavaMethod to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
56 boolean isDontInline();
9416
16c354398d09 intrinsify Reflection.getCallerClass
twisti
parents: 9380
diff changeset
57
16c354398d09 intrinsify Reflection.getCallerClass
twisti
parents: 9380
diff changeset
58 /**
12532
9b1cc2628961 Extend the CompilerToVM interface to explicitly avoid compilation and inlining of methods
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 12464
diff changeset
59 * Manually adds a DontInline annotation to this method.
9b1cc2628961 Extend the CompilerToVM interface to explicitly avoid compilation and inlining of methods
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 12464
diff changeset
60 */
18222
a8cff27ca2e1 converted HotSpotResolvedJavaMethod to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
61 void setNotInlineable();
12532
9b1cc2628961 Extend the CompilerToVM interface to explicitly avoid compilation and inlining of methods
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 12464
diff changeset
62
9b1cc2628961 Extend the CompilerToVM interface to explicitly avoid compilation and inlining of methods
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 12464
diff changeset
63 /**
9416
16c354398d09 intrinsify Reflection.getCallerClass
twisti
parents: 9380
diff changeset
64 * Returns true if this method is one of the special methods that is ignored by security stack
16c354398d09 intrinsify Reflection.getCallerClass
twisti
parents: 9380
diff changeset
65 * walks.
15018
db4254246f9a Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents: 14717
diff changeset
66 *
9416
16c354398d09 intrinsify Reflection.getCallerClass
twisti
parents: 9380
diff changeset
67 * @return true if special method ignored by security stack walks, false otherwise
16c354398d09 intrinsify Reflection.getCallerClass
twisti
parents: 9380
diff changeset
68 */
18222
a8cff27ca2e1 converted HotSpotResolvedJavaMethod to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
69 boolean ignoredBySecurityStackWalk();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
70
18222
a8cff27ca2e1 converted HotSpotResolvedJavaMethod to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
71 boolean hasBalancedMonitors();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
72
18323
301c5e3d683a removed *Impl types in signatures of Remote interfaces
Doug Simon <doug.simon@oracle.com>
parents: 18223
diff changeset
73 ResolvedJavaMethod uniqueConcreteMethod(HotSpotResolvedObjectType receiver);
14107
800057208a2c enable C1 + Graal tiered
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14105
diff changeset
74
800057208a2c enable C1 + Graal tiered
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14105
diff changeset
75 /**
800057208a2c enable C1 + Graal tiered
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14105
diff changeset
76 * Returns whether this method has compiled code.
15018
db4254246f9a Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents: 14717
diff changeset
77 *
14107
800057208a2c enable C1 + Graal tiered
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14105
diff changeset
78 * @return true if this method has compiled code, false otherwise
800057208a2c enable C1 + Graal tiered
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14105
diff changeset
79 */
18222
a8cff27ca2e1 converted HotSpotResolvedJavaMethod to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
80 boolean hasCompiledCode();
14107
800057208a2c enable C1 + Graal tiered
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14105
diff changeset
81
800057208a2c enable C1 + Graal tiered
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14105
diff changeset
82 /**
14607
7573ba6dfba2 fix comment
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14545
diff changeset
83 * @param level
7573ba6dfba2 fix comment
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14545
diff changeset
84 * @return true if the currently installed code was generated at {@code level}.
14107
800057208a2c enable C1 + Graal tiered
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14105
diff changeset
85 */
18222
a8cff27ca2e1 converted HotSpotResolvedJavaMethod to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
86 boolean hasCompiledCodeAtLevel(int level);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
87
18222
a8cff27ca2e1 converted HotSpotResolvedJavaMethod to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
88 ProfilingInfo getCompilationProfilingInfo(boolean isOSR);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
89
18222
a8cff27ca2e1 converted HotSpotResolvedJavaMethod to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
90 default boolean isDefault() {
13183
0266ac3b26c0 JDK8: added support for default methods as well as interfaces containing static and private methods
Doug Simon <doug.simon@oracle.com>
parents: 13164
diff changeset
91 if (isConstructor()) {
0266ac3b26c0 JDK8: added support for default methods as well as interfaces containing static and private methods
Doug Simon <doug.simon@oracle.com>
parents: 13164
diff changeset
92 return false;
0266ac3b26c0 JDK8: added support for default methods as well as interfaces containing static and private methods
Doug Simon <doug.simon@oracle.com>
parents: 13164
diff changeset
93 }
0266ac3b26c0 JDK8: added support for default methods as well as interfaces containing static and private methods
Doug Simon <doug.simon@oracle.com>
parents: 13164
diff changeset
94 // Copied from java.lang.Method.isDefault()
0266ac3b26c0 JDK8: added support for default methods as well as interfaces containing static and private methods
Doug Simon <doug.simon@oracle.com>
parents: 13164
diff changeset
95 int mask = Modifier.ABSTRACT | Modifier.PUBLIC | Modifier.STATIC;
0266ac3b26c0 JDK8: added support for default methods as well as interfaces containing static and private methods
Doug Simon <doug.simon@oracle.com>
parents: 13164
diff changeset
96 return ((getModifiers() & mask) == Modifier.PUBLIC) && getDeclaringClass().isInterface();
0266ac3b26c0 JDK8: added support for default methods as well as interfaces containing static and private methods
Doug Simon <doug.simon@oracle.com>
parents: 13164
diff changeset
97 }
0266ac3b26c0 JDK8: added support for default methods as well as interfaces containing static and private methods
Doug Simon <doug.simon@oracle.com>
parents: 13164
diff changeset
98
6379
ad97777056ec Checks on vtableEntryOffset to avoid calling to the VM if the holder is not initialized
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5775
diff changeset
99 /**
12559
ae412befde21 read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents: 12535
diff changeset
100 * Returns the offset of this method into the v-table. The method must have a v-table entry as
15725
ef6b8d1898e6 Add resolved receiver type to ResolvedJavaMethod.isInVirtualMethodTable in order to be able to do vtable-calls for miranda and default methods
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15722
diff changeset
101 * indicated by {@link #isInVirtualMethodTable(ResolvedJavaType)}, otherwise an exception is
ef6b8d1898e6 Add resolved receiver type to ResolvedJavaMethod.isInVirtualMethodTable in order to be able to do vtable-calls for miranda and default methods
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15722
diff changeset
102 * thrown.
15018
db4254246f9a Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents: 14717
diff changeset
103 *
6379
ad97777056ec Checks on vtableEntryOffset to avoid calling to the VM if the holder is not initialized
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5775
diff changeset
104 * @return the offset of this method into the v-table
ad97777056ec Checks on vtableEntryOffset to avoid calling to the VM if the holder is not initialized
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5775
diff changeset
105 */
18222
a8cff27ca2e1 converted HotSpotResolvedJavaMethod to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
106 int vtableEntryOffset(ResolvedJavaType resolved);
15725
ef6b8d1898e6 Add resolved receiver type to ResolvedJavaMethod.isInVirtualMethodTable in order to be able to do vtable-calls for miranda and default methods
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15722
diff changeset
107
18222
a8cff27ca2e1 converted HotSpotResolvedJavaMethod to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
108 int intrinsicId();
10056
a323a9e20f9d Fixed a few race conditions in the compilation queue.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 10000
diff changeset
109
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14089
diff changeset
110 /**
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14089
diff changeset
111 * Allocates a compile id for this method by asking the VM for one.
15018
db4254246f9a Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents: 14717
diff changeset
112 *
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14089
diff changeset
113 * @param entryBCI entry bci
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14089
diff changeset
114 * @return compile id
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14089
diff changeset
115 */
18222
a8cff27ca2e1 converted HotSpotResolvedJavaMethod to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
116 int allocateCompileId(int entryBCI);
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14089
diff changeset
117
18222
a8cff27ca2e1 converted HotSpotResolvedJavaMethod to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
118 boolean hasCodeAtLevel(int entryBCI, int level);
a8cff27ca2e1 converted HotSpotResolvedJavaMethod to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
119
a8cff27ca2e1 converted HotSpotResolvedJavaMethod to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
120 SpeculationLog getSpeculationLog();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
121 }