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
24 package jdk.vm.ci.hotspot;
25
26 import jdk.vm.ci.code.InstalledCode;
27 import jdk.vm.ci.code.InvalidInstalledCodeException;
28 import jdk.vm.ci.code.TargetDescription;
29 import jdk.vm.ci.meta.ConstantPool;
30 import jdk.vm.ci.meta.ResolvedJavaMethod;
31
32 /**
33 * A simple "proxy" class to get test access to CompilerToVM package-private methods
34 */
35 public class CompilerToVMHelper {
36 public static final CompilerToVM CTVM = new CompilerToVM();
37
38 public static byte[] getBytecode(HotSpotResolvedJavaMethod method) {
39 return CTVM.getBytecode((HotSpotResolvedJavaMethodImpl)method);
40 }
41
42 public static int getExceptionTableLength(HotSpotResolvedJavaMethod method) {
43 return CTVM.getExceptionTableLength((HotSpotResolvedJavaMethodImpl)method);
44 }
45
46 public static long getExceptionTableStart(HotSpotResolvedJavaMethod method) {
47 return CTVM.getExceptionTableStart((HotSpotResolvedJavaMethodImpl)method);
48 }
49
50 public static boolean canInlineMethod(HotSpotResolvedJavaMethod method) {
154 public static Object[] readConfiguration() {
155 return CTVM.readConfiguration();
156 }
157
158 public static HotSpotResolvedJavaMethod resolveMethod(
159 HotSpotResolvedObjectType exactReceiver,
160 HotSpotResolvedJavaMethod method,
161 HotSpotResolvedObjectType caller) {
162 return CTVM.resolveMethod((HotSpotResolvedObjectTypeImpl) exactReceiver, (HotSpotResolvedJavaMethodImpl) method, (HotSpotResolvedObjectTypeImpl) caller);
163 }
164
165 public static HotSpotResolvedJavaMethod getClassInitializer(
166 HotSpotResolvedObjectType type) {
167 return CTVM.getClassInitializer((HotSpotResolvedObjectTypeImpl) type);
168 }
169
170 public static boolean hasFinalizableSubclass(HotSpotResolvedObjectType type) {
171 return CTVM.hasFinalizableSubclass((HotSpotResolvedObjectTypeImpl) type);
172 }
173
174 public static HotSpotResolvedJavaMethodImpl getResolvedJavaMethodAtSlot(
175 Class<?> holder, int slot) {
176 return CTVM.getResolvedJavaMethodAtSlot(holder, slot);
177 }
178
179 public static long getMaxCallTargetOffset(long address) {
180 return CTVM.getMaxCallTargetOffset(address);
181 }
182
183 public static String disassembleCodeBlob(InstalledCode codeBlob) {
184 return CTVM.disassembleCodeBlob(codeBlob);
185 }
186
187 public static StackTraceElement getStackTraceElement(
188 HotSpotResolvedJavaMethod method, int bci) {
189 return CTVM.getStackTraceElement((HotSpotResolvedJavaMethodImpl)method, bci);
190 }
191
192 public static Object executeInstalledCode(Object[] args,
193 InstalledCode installedCode) throws InvalidInstalledCodeException {
194 return CTVM.executeInstalledCode(args, installedCode);
195 }
196
|
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
24 package jdk.vm.ci.hotspot;
25
26 import jdk.vm.ci.code.InstalledCode;
27 import jdk.vm.ci.code.InvalidInstalledCodeException;
28 import jdk.vm.ci.code.TargetDescription;
29 import jdk.vm.ci.meta.ConstantPool;
30 import jdk.vm.ci.meta.ResolvedJavaMethod;
31 import java.lang.reflect.Executable;
32
33 /**
34 * A simple "proxy" class to get test access to CompilerToVM package-private methods
35 */
36 public class CompilerToVMHelper {
37 public static final CompilerToVM CTVM = new CompilerToVM();
38
39 public static byte[] getBytecode(HotSpotResolvedJavaMethod method) {
40 return CTVM.getBytecode((HotSpotResolvedJavaMethodImpl)method);
41 }
42
43 public static int getExceptionTableLength(HotSpotResolvedJavaMethod method) {
44 return CTVM.getExceptionTableLength((HotSpotResolvedJavaMethodImpl)method);
45 }
46
47 public static long getExceptionTableStart(HotSpotResolvedJavaMethod method) {
48 return CTVM.getExceptionTableStart((HotSpotResolvedJavaMethodImpl)method);
49 }
50
51 public static boolean canInlineMethod(HotSpotResolvedJavaMethod method) {
155 public static Object[] readConfiguration() {
156 return CTVM.readConfiguration();
157 }
158
159 public static HotSpotResolvedJavaMethod resolveMethod(
160 HotSpotResolvedObjectType exactReceiver,
161 HotSpotResolvedJavaMethod method,
162 HotSpotResolvedObjectType caller) {
163 return CTVM.resolveMethod((HotSpotResolvedObjectTypeImpl) exactReceiver, (HotSpotResolvedJavaMethodImpl) method, (HotSpotResolvedObjectTypeImpl) caller);
164 }
165
166 public static HotSpotResolvedJavaMethod getClassInitializer(
167 HotSpotResolvedObjectType type) {
168 return CTVM.getClassInitializer((HotSpotResolvedObjectTypeImpl) type);
169 }
170
171 public static boolean hasFinalizableSubclass(HotSpotResolvedObjectType type) {
172 return CTVM.hasFinalizableSubclass((HotSpotResolvedObjectTypeImpl) type);
173 }
174
175 public static HotSpotResolvedJavaMethodImpl asResolvedJavaMethod(
176 Executable executable) {
177 return CTVM.asResolvedJavaMethod(executable);
178 }
179
180 public static long getMaxCallTargetOffset(long address) {
181 return CTVM.getMaxCallTargetOffset(address);
182 }
183
184 public static String disassembleCodeBlob(InstalledCode codeBlob) {
185 return CTVM.disassembleCodeBlob(codeBlob);
186 }
187
188 public static StackTraceElement getStackTraceElement(
189 HotSpotResolvedJavaMethod method, int bci) {
190 return CTVM.getStackTraceElement((HotSpotResolvedJavaMethodImpl)method, bci);
191 }
192
193 public static Object executeInstalledCode(Object[] args,
194 InstalledCode installedCode) throws InvalidInstalledCodeException {
195 return CTVM.executeInstalledCode(args, installedCode);
196 }
197
|