author | hannesw |
Fri, 24 May 2019 16:53:44 +0200 | |
changeset 58624 | 26867ad686e9 |
parent 52381 | 7f90bc64b0fc |
permissions | -rw-r--r-- |
43972 | 1 |
/* |
47668 | 2 |
* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. |
43972 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
*/ |
|
23 |
package jdk.vm.ci.hotspot; |
|
24 |
||
25 |
import java.lang.reflect.Modifier; |
|
26 |
||
27 |
import jdk.vm.ci.meta.JavaMethod; |
|
28 |
import jdk.vm.ci.meta.ResolvedJavaMethod; |
|
29 |
import jdk.vm.ci.meta.ResolvedJavaType; |
|
30 |
||
31 |
/** |
|
32 |
* Implementation of {@link JavaMethod} for resolved HotSpot methods. |
|
33 |
*/ |
|
34 |
public interface HotSpotResolvedJavaMethod extends ResolvedJavaMethod { |
|
35 |
||
36 |
/** |
|
37 |
* Returns true if this method has a {@code CallerSensitive} annotation. |
|
38 |
* |
|
39 |
* @return true if CallerSensitive annotation present, false otherwise |
|
40 |
*/ |
|
41 |
boolean isCallerSensitive(); |
|
42 |
||
50858 | 43 |
@Override |
43972 | 44 |
HotSpotResolvedObjectType getDeclaringClass(); |
45 |
||
46 |
/** |
|
47 |
* Returns true if this method has a {@code ForceInline} annotation. |
|
48 |
* |
|
49 |
* @return true if ForceInline annotation present, false otherwise |
|
50 |
*/ |
|
51 |
boolean isForceInline(); |
|
52 |
||
53 |
/** |
|
54 |
* Returns true if this method has a {@code ReservedStackAccess} annotation. |
|
55 |
* |
|
56 |
* @return true if ReservedStackAccess annotation present, false otherwise |
|
57 |
*/ |
|
58 |
boolean hasReservedStackAccess(); |
|
59 |
||
60 |
/** |
|
52381
7f90bc64b0fc
8213203: [JVMCI] adopt formatting changes from jvmci 8
never
parents:
50858
diff
changeset
|
61 |
* Sets flags on {@code method} indicating that it should never be inlined or compiled by the |
7f90bc64b0fc
8213203: [JVMCI] adopt formatting changes from jvmci 8
never
parents:
50858
diff
changeset
|
62 |
* VM. |
43972 | 63 |
*/ |
47793
3dcd54513db1
8186478: [JVMCI] rename HotSpotResolvedJavaMethod#setNotInlineableOrCompileable
dnsimon
parents:
47668
diff
changeset
|
64 |
void setNotInlinableOrCompilable(); |
43972 | 65 |
|
66 |
/** |
|
67 |
* Returns true if this method is one of the special methods that is ignored by security stack |
|
68 |
* walks. |
|
69 |
* |
|
70 |
* @return true if special method ignored by security stack walks, false otherwise |
|
71 |
*/ |
|
72 |
boolean ignoredBySecurityStackWalk(); |
|
73 |
||
74 |
ResolvedJavaMethod uniqueConcreteMethod(HotSpotResolvedObjectType receiver); |
|
75 |
||
76 |
/** |
|
77 |
* Returns whether this method has compiled code. |
|
78 |
* |
|
79 |
* @return true if this method has compiled code, false otherwise |
|
80 |
*/ |
|
81 |
boolean hasCompiledCode(); |
|
82 |
||
83 |
/** |
|
84 |
* @param level |
|
85 |
* @return true if the currently installed code was generated at {@code level}. |
|
86 |
*/ |
|
87 |
boolean hasCompiledCodeAtLevel(int level); |
|
88 |
||
50858 | 89 |
@Override |
43972 | 90 |
default boolean isDefault() { |
91 |
if (isConstructor()) { |
|
92 |
return false; |
|
93 |
} |
|
94 |
// Copied from java.lang.Method.isDefault() |
|
95 |
int mask = Modifier.ABSTRACT | Modifier.PUBLIC | Modifier.STATIC; |
|
96 |
return ((getModifiers() & mask) == Modifier.PUBLIC) && getDeclaringClass().isInterface(); |
|
97 |
} |
|
98 |
||
99 |
/** |
|
100 |
* Returns the offset of this method into the v-table. The method must have a v-table entry as |
|
101 |
* indicated by {@link #isInVirtualMethodTable(ResolvedJavaType)}, otherwise an exception is |
|
102 |
* thrown. |
|
103 |
* |
|
104 |
* @return the offset of this method into the v-table |
|
105 |
*/ |
|
106 |
int vtableEntryOffset(ResolvedJavaType resolved); |
|
107 |
||
108 |
int intrinsicId(); |
|
109 |
||
110 |
/** |
|
111 |
* Determines if this method denotes itself as a candidate for intrinsification. As of JDK 9, |
|
112 |
* this is denoted by the {@code HotSpotIntrinsicCandidate} annotation. In earlier JDK versions, |
|
113 |
* this method returns true. |
|
114 |
* |
|
115 |
* @see <a href="https://bugs.openjdk.java.net/browse/JDK-8076112">JDK-8076112</a> |
|
116 |
*/ |
|
117 |
boolean isIntrinsicCandidate(); |
|
118 |
||
119 |
/** |
|
120 |
* Allocates a compile id for this method by asking the VM for one. |
|
121 |
* |
|
122 |
* @param entryBCI entry bci |
|
123 |
* @return compile id |
|
124 |
*/ |
|
125 |
int allocateCompileId(int entryBCI); |
|
126 |
||
127 |
boolean hasCodeAtLevel(int entryBCI, int level); |
|
47668 | 128 |
|
129 |
int methodIdnum(); |
|
43972 | 130 |
} |