< prev index next >

test/compiler/jvmci/compilerToVM/CompileCodeTestCase.java

Print this page

        

@@ -22,12 +22,14 @@
  *
  */
 
 package compiler.jvmci.compilerToVM;
 
+import compiler.jvmci.common.CTVMUtilities;
 import compiler.testlibrary.CompilerUtils;
 import jdk.test.lib.Utils;
+import jdk.vm.ci.code.InstalledCode;
 import sun.hotspot.WhiteBox;
 import sun.hotspot.code.NMethod;
 
 import java.lang.reflect.Executable;
 import java.lang.reflect.Modifier;

@@ -100,10 +102,18 @@
 
     public NMethod toNMethod() {
         return NMethod.get(executable, isOsr);
     }
 
+    public InstalledCode toInstalledCode() {
+        NMethod nmethod = toNMethod();
+        long address = nmethod == null ? 0L : nmethod.address;
+        long entryPoint = nmethod == null ? 0L : nmethod.entry_point;
+        return CTVMUtilities.getInstalledCode(
+                executable.getName(), address, entryPoint);
+    }
+
     @Override
     public String toString() {
         return "CompileCodeTestCase{" +
                 "executable=" + executable +
                 ", bci=" + bci +
< prev index next >