changeset 1577:e1e2a0c7cbee

8080511: Refresh of jimage support Reviewed-by: alanb, mchung, psandoz, acorn, lfoltan, ctornqvi Contributed-by: james.laskey@oracle.com, jean-francois.denise@oracle.com, sundararajan.athijegannathan@oracle.com
author jfdenise
date Thu, 25 Jun 2015 18:00:28 +0200
parents eb73a0188328
children dda15fdffd28
files modules.xml test/lib/sun/hotspot/WhiteBox.java
diffstat 2 files changed, 22 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/modules.xml	Wed Jun 24 15:29:34 2015 -0700
+++ b/modules.xml	Thu Jun 25 18:00:28 2015 +0200
@@ -219,6 +219,10 @@
       <to>jdk.dev</to>
     </export>
     <export>
+      <name>jdk.internal.jimage.decompressor</name>
+      <to>jdk.dev</to>
+    </export>
+    <export>
       <name>jdk.internal.org.objectweb.asm</name>
       <to>java.instrument</to>
       <to>jdk.jfr</to>
--- a/test/lib/sun/hotspot/WhiteBox.java	Wed Jun 24 15:29:34 2015 -0700
+++ b/test/lib/sun/hotspot/WhiteBox.java	Thu Jun 25 18:00:28 2015 +0200
@@ -26,6 +26,7 @@
 
 import java.lang.management.MemoryUsage;
 import java.lang.reflect.Executable;
+import java.nio.ByteBuffer;
 import java.util.Arrays;
 import java.util.List;
 import java.util.function.BiFunction;
@@ -37,7 +38,6 @@
 import sun.hotspot.parser.DiagnosticCommand;
 
 public class WhiteBox {
-
   @SuppressWarnings("serial")
   public static class WhiteBoxPermission extends BasicPermission {
     public WhiteBoxPermission(String s) {
@@ -362,6 +362,23 @@
                               .orElse(null);
   }
 
+  public native boolean readImageFile(String imagePath);
+  public native long imageOpenImage(String imagePath, boolean bigEndian);
+  public native void imageCloseImage(long id);
+  public native long imageGetIndexAddress(long id);
+  public native long imageGetDataAddress(long id);
+  public native boolean imageReadCompressed(long id, long offset,
+    ByteBuffer compressedBuffer, long compressedSize,
+    ByteBuffer uncompressedBuffer, long uncompressedSize);
+  public native boolean imageRead(long id, long offset,
+    ByteBuffer uncompressedBuffer, long uncompressedSize);
+  public native byte[] imageGetStringBytes(long id, int offset);
+  public native long imageGetStringsSize(long id);
+  public native long[] imageGetAttributes(long id, int offset);
+  public native long[] imageFindAttributes(long id, byte[] path);
+  public native int[] imageAttributeOffsets(long id);
+  public native int imageGetIntAtAddress(long address, int offset, boolean big_endian);
+
   // Safepoint Checking
   public native void assertMatchingSafepointCalls(boolean mutexSafepointValue, boolean attemptedNoSafepointValue);