< prev index next >

src/java.base/share/classes/jdk/internal/foreign/abi/SystemABI.java

Print this page




 109      * Obtain given calling convention by name (if available).
 110      */
 111     CallingConvention namedCallingConvention(String name) throws IllegalArgumentException;
 112 
 113     /**
 114      * Query list of supported calling conventions.
 115      */
 116     Collection<CallingConvention> callingConventions();
 117 
 118     /**
 119      * A calling convention specifies how arguments and return types are communicated
 120      * from caller to callee.
 121      */
 122     interface CallingConvention {
 123         String name();
 124     }
 125 
 126     static SystemABI getInstance() {
 127         String arch = System.getProperty("os.arch");
 128         String os = System.getProperty("os.name");
 129         if (arch.equals("amd64")) {
 130             if (os.startsWith("Windows")) {
 131                 return Windowsx64ABI.getInstance();
 132             } else {
 133                 return SysVx64ABI.getInstance();
 134             }
 135         }
 136         throw new UnsupportedOperationException("Unsupported os or arch: " + os + ", " + arch);
 137     }
 138 }


 109      * Obtain given calling convention by name (if available).
 110      */
 111     CallingConvention namedCallingConvention(String name) throws IllegalArgumentException;
 112 
 113     /**
 114      * Query list of supported calling conventions.
 115      */
 116     Collection<CallingConvention> callingConventions();
 117 
 118     /**
 119      * A calling convention specifies how arguments and return types are communicated
 120      * from caller to callee.
 121      */
 122     interface CallingConvention {
 123         String name();
 124     }
 125 
 126     static SystemABI getInstance() {
 127         String arch = System.getProperty("os.arch");
 128         String os = System.getProperty("os.name");
 129         if (arch.equals("amd64") || arch.equals("x86_64")) {
 130             if (os.startsWith("Windows")) {
 131                 return Windowsx64ABI.getInstance();
 132             } else {
 133                 return SysVx64ABI.getInstance();
 134             }
 135         }
 136         throw new UnsupportedOperationException("Unsupported os or arch: " + os + ", " + arch);
 137     }
 138 }
< prev index next >