hotspot/src/share/vm/classfile/jimage.hpp
changeset 36508 5f9eee6b383b
parent 32619 47acec81dcca
child 37489 b2812e811d0d
equal deleted inserted replaced
36507:c80f6ecb0bb3 36508:5f9eee6b383b
     1 /*
     1 /*
     2  * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    20  * or visit www.oracle.com if you need additional information or have any
    20  * or visit www.oracle.com if you need additional information or have any
    21  * questions.
    21  * questions.
    22  *
    22  *
    23  */
    23  */
    24 
    24 
    25 #include "jni.h"
    25 #include "prims/jni.h"
    26 
    26 
    27 // Opaque reference to a JImage file.
    27 // Opaque reference to a JImage file.
    28 class JImageFile;
    28 class JImageFile;
    29 // Opaque reference to an image file resource location.
    29 // Opaque reference to an image file resource location.
    30 typedef jlong JImageLocationRef;
    30 typedef jlong JImageLocationRef;
    33 // other platforms use 4096.  The JCK fails several tests when 1024 is used.
    33 // other platforms use 4096.  The JCK fails several tests when 1024 is used.
    34 #define JIMAGE_MAX_PATH 4096
    34 #define JIMAGE_MAX_PATH 4096
    35 
    35 
    36 // JImage Error Codes
    36 // JImage Error Codes
    37 
    37 
       
    38 // Resource was not found
       
    39 #define JIMAGE_NOT_FOUND (0)
    38 // The image file is not prefixed with 0xCAFEDADA
    40 // The image file is not prefixed with 0xCAFEDADA
    39 #define JIMAGE_BAD_MAGIC (-1)
    41 #define JIMAGE_BAD_MAGIC (-1)
    40 // The image file does not have a compatible (translatable) version
    42 // The image file does not have a compatible (translatable) version
    41 #define JIMAGE_BAD_VERSION (-2)
    43 #define JIMAGE_BAD_VERSION (-2)
    42 // The image file content is malformed
    44 // The image file content is malformed
    53  * failure; a positive value for a system error number, negative for a jimage
    55  * failure; a positive value for a system error number, negative for a jimage
    54  * specific error (see JImage Error Codes.)
    56  * specific error (see JImage Error Codes.)
    55  *
    57  *
    56  *  Ex.
    58  *  Ex.
    57  *   jint error;
    59  *   jint error;
    58  *   JImageFile* jimage = (*JImageOpen)(JAVA_HOME "lib/modules/bootmodules.jimage", &error);
    60  *   JImageFile* jimage = (*JImageOpen)(JAVA_HOME "lib/modules", &error);
    59  *   if (image == NULL) {
    61  *   if (image == NULL) {
    60  *     tty->print_cr("JImage failed to open: %d", error);
    62  *     tty->print_cr("JImage failed to open: %d", error);
    61  *     ...
    63  *     ...
    62  *   }
    64  *   }
    63  *   ...
    65  *   ...