# HG changeset patch # User Doug Simon # Date 1381994758 -7200 # Node ID 88d451c7c48491c01541588a1d23aceeb23fe571 # Parent 3e559d1db048f0006baad95938e66e2161643911 factored out retrieving the host architecture name to handle variations in value of os.arch system property diff -r 3e559d1db048 -r 88d451c7c484 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java Wed Oct 16 22:06:58 2013 -0700 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java Thu Oct 17 09:25:58 2013 +0200 @@ -213,7 +213,7 @@ printConfig(config); } - String hostArchitecture = System.getProperty("os.arch"); + String hostArchitecture = getHostArchitecture(); hostBackend = findFactory(hostArchitecture).createBackend(this, null); hostProviders = hostBackend.getProviders(); backends.put(hostArchitecture, hostBackend); @@ -237,12 +237,30 @@ } /** - * Gets the supported GPUs. This method first looks for a comma separated list of names in the - * "graal.gpu.isalist" system property. If this property is not set, then the GPU native support - * code is queried. + * Gets the host architecture name for the purpose of finding the corresponding + * {@linkplain HotSpotBackendFactory backend}. + */ + private static String getHostArchitecture() { + String arch = System.getProperty("os.arch"); + switch (arch) { + case "x86_64": + // This is what Mac OS X reports; + arch = "amd64"; + break; + } + return arch; + } + + public static final String GRAAL_GPU_ISALIST_PROPERTY_NAME = "graal.gpu.isalist"; + + /** + * Gets the names of the supported GPU architectures for the purpose of finding the + * corresponding {@linkplain HotSpotBackendFactory backend} objects. This method first looks for + * a comma separated list of names in the {@value #GRAAL_GPU_ISALIST_PROPERTY_NAME} system + * property. If this property is not set, then the GPU native support code is queried. */ private String[] getGPUArchitectures() { - String gpuList = System.getProperty("graal.gpu.isalist"); + String gpuList = System.getProperty(GRAAL_GPU_ISALIST_PROPERTY_NAME); if (gpuList != null) { String[] gpus = gpuList.split(","); return gpus;