# HG changeset patch # User Doug Simon # Date 1433284244 -7200 # Node ID 2e8c01def9a5dfda74915988cb1fe91c24f66aaa # Parent e0b5d4fcd929eb9abeee3980eaba08aefc6e0330 moved [AMD64|SPARC]HotSpotJVMCIBackendFactory into JVMCI namespace (JBS:GRAAL-53) diff -r e0b5d4fcd929 -r 2e8c01def9a5 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/jvmci/AMD64HotSpotJVMCIBackendFactory.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/jvmci/AMD64HotSpotJVMCIBackendFactory.java Tue Jun 02 23:29:27 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,170 +0,0 @@ -/* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.hotspot.amd64.jvmci; - -import static com.oracle.jvmci.hotspot.InitTimer.*; - -import java.util.*; - -import com.oracle.jvmci.amd64.*; -import com.oracle.jvmci.code.*; -import com.oracle.jvmci.hotspot.*; -import com.oracle.jvmci.hotspot.amd64.*; -import com.oracle.jvmci.meta.*; -import com.oracle.jvmci.runtime.*; -import com.oracle.jvmci.service.*; - -@ServiceProvider(HotSpotJVMCIBackendFactory.class) -public class AMD64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory { - - protected Architecture createArchitecture(HotSpotVMConfig config) { - return new AMD64(computeFeatures(config), computeFlags(config)); - } - - protected EnumSet computeFeatures(HotSpotVMConfig config) { - // Configure the feature set using the HotSpot flag settings. - EnumSet features = EnumSet.noneOf(AMD64.CPUFeature.class); - assert config.useSSE >= 2 : "minimum config for x64"; - features.add(AMD64.CPUFeature.SSE); - features.add(AMD64.CPUFeature.SSE2); - if ((config.x86CPUFeatures & config.cpuSSE3) != 0) { - features.add(AMD64.CPUFeature.SSE3); - } - if ((config.x86CPUFeatures & config.cpuSSSE3) != 0) { - features.add(AMD64.CPUFeature.SSSE3); - } - if ((config.x86CPUFeatures & config.cpuSSE4A) != 0) { - features.add(AMD64.CPUFeature.SSE4a); - } - if ((config.x86CPUFeatures & config.cpuSSE41) != 0) { - features.add(AMD64.CPUFeature.SSE4_1); - } - if ((config.x86CPUFeatures & config.cpuSSE42) != 0) { - features.add(AMD64.CPUFeature.SSE4_2); - } - if ((config.x86CPUFeatures & config.cpuAVX) != 0) { - features.add(AMD64.CPUFeature.AVX); - } - if ((config.x86CPUFeatures & config.cpuAVX2) != 0) { - features.add(AMD64.CPUFeature.AVX2); - } - if ((config.x86CPUFeatures & config.cpuERMS) != 0) { - features.add(AMD64.CPUFeature.ERMS); - } - if ((config.x86CPUFeatures & config.cpuLZCNT) != 0) { - features.add(AMD64.CPUFeature.LZCNT); - } - if ((config.x86CPUFeatures & config.cpuPOPCNT) != 0) { - features.add(AMD64.CPUFeature.POPCNT); - } - if ((config.x86CPUFeatures & config.cpuAES) != 0) { - features.add(AMD64.CPUFeature.AES); - } - if ((config.x86CPUFeatures & config.cpu3DNOWPREFETCH) != 0) { - features.add(AMD64.CPUFeature.AMD_3DNOW_PREFETCH); - } - if ((config.x86CPUFeatures & config.cpuBMI1) != 0) { - features.add(AMD64.CPUFeature.BMI1); - } - return features; - } - - protected EnumSet computeFlags(HotSpotVMConfig config) { - EnumSet flags = EnumSet.noneOf(AMD64.Flag.class); - if (config.useCountLeadingZerosInstruction) { - flags.add(AMD64.Flag.UseCountLeadingZerosInstruction); - } - if (config.useCountTrailingZerosInstruction) { - flags.add(AMD64.Flag.UseCountTrailingZerosInstruction); - } - return flags; - } - - protected TargetDescription createTarget(HotSpotVMConfig config) { - final int stackFrameAlignment = 16; - final int implicitNullCheckLimit = 4096; - final boolean inlineObjects = true; - return new HotSpotTargetDescription(createArchitecture(config), true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects); - } - - protected HotSpotConstantReflectionProvider createConstantReflection(HotSpotJVMCIRuntimeProvider runtime) { - return new HotSpotConstantReflectionProvider(runtime); - } - - protected RegisterConfig createRegisterConfig(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target) { - return new AMD64HotSpotRegisterConfig(target.arch, runtime.getConfig()); - } - - protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target, RegisterConfig regConfig) { - return new HotSpotCodeCacheProvider(runtime, runtime.getConfig(), target, regConfig); - } - - protected HotSpotMetaAccessProvider createMetaAccess(HotSpotJVMCIRuntimeProvider runtime) { - return new HotSpotMetaAccessProvider(runtime); - } - - public String getArchitecture() { - return "AMD64"; - } - - @Override - public String toString() { - return getJVMCIRuntimeName() + ":" + getArchitecture(); - } - - public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, JVMCIBackend host) { - - assert host == null; - TargetDescription target = createTarget(runtime.getConfig()); - - RegisterConfig regConfig; - HotSpotCodeCacheProvider codeCache; - ConstantReflectionProvider constantReflection; - HotSpotMetaAccessProvider metaAccess; - try (InitTimer t = timer("create providers")) { - try (InitTimer rt = timer("create MetaAccess provider")) { - metaAccess = createMetaAccess(runtime); - } - try (InitTimer rt = timer("create RegisterConfig")) { - regConfig = createRegisterConfig(runtime, target); - } - try (InitTimer rt = timer("create CodeCache provider")) { - codeCache = createCodeCache(runtime, target, regConfig); - } - try (InitTimer rt = timer("create ConstantReflection provider")) { - constantReflection = createConstantReflection(runtime); - } - } - try (InitTimer rt = timer("instantiate backend")) { - return createBackend(metaAccess, codeCache, constantReflection); - } - } - - protected JVMCIBackend createBackend(HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, ConstantReflectionProvider constantReflection) { - return new JVMCIBackend(metaAccess, codeCache, constantReflection); - } - - public String getJVMCIRuntimeName() { - return "basic"; - } -} diff -r e0b5d4fcd929 -r 2e8c01def9a5 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/jvmci/SPARCHotSpotJVMCIBackendFactory.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/jvmci/SPARCHotSpotJVMCIBackendFactory.java Tue Jun 02 23:29:27 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.hotspot.sparc.jvmci; - -import static com.oracle.jvmci.hotspot.InitTimer.*; - -import java.util.*; - -import com.oracle.jvmci.code.*; -import com.oracle.jvmci.hotspot.*; -import com.oracle.jvmci.hotspot.sparc.*; -import com.oracle.jvmci.runtime.*; -import com.oracle.jvmci.service.*; -import com.oracle.jvmci.sparc.*; -import com.oracle.jvmci.sparc.SPARC.*; - -@ServiceProvider(HotSpotJVMCIBackendFactory.class) -public class SPARCHotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory { - - protected Architecture createArchitecture(HotSpotVMConfig config) { - return new SPARC(computeFeatures(config)); - } - - protected TargetDescription createTarget(HotSpotVMConfig config) { - final int stackFrameAlignment = 16; - final int implicitNullCheckLimit = 4096; - final boolean inlineObjects = true; - return new HotSpotTargetDescription(createArchitecture(config), true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects); - } - - protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target, RegisterConfig regConfig) { - return new HotSpotCodeCacheProvider(runtime, runtime.getConfig(), target, regConfig); - } - - protected EnumSet computeFeatures(HotSpotVMConfig config) { - EnumSet features = EnumSet.noneOf(CPUFeature.class); - if ((config.sparcFeatures & config.vis1Instructions) != 0) { - features.add(CPUFeature.VIS1); - } - if ((config.sparcFeatures & config.vis2Instructions) != 0) { - features.add(CPUFeature.VIS2); - } - if ((config.sparcFeatures & config.vis3Instructions) != 0) { - features.add(CPUFeature.VIS3); - } - if ((config.sparcFeatures & config.cbcondInstructions) != 0) { - features.add(CPUFeature.CBCOND); - } - return features; - } - - public String getArchitecture() { - return "SPARC"; - } - - @Override - public String toString() { - return getJVMCIRuntimeName() + ":" + getArchitecture(); - } - - public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, JVMCIBackend host) { - assert host == null; - TargetDescription target = createTarget(runtime.getConfig()); - - HotSpotMetaAccessProvider metaAccess = new HotSpotMetaAccessProvider(runtime); - RegisterConfig regConfig = new SPARCHotSpotRegisterConfig(target, runtime.getConfig()); - HotSpotCodeCacheProvider codeCache = createCodeCache(runtime, target, regConfig); - HotSpotConstantReflectionProvider constantReflection = new HotSpotConstantReflectionProvider(runtime); - try (InitTimer rt = timer("instantiate backend")) { - return createBackend(metaAccess, codeCache, constantReflection); - } - } - - protected JVMCIBackend createBackend(HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, HotSpotConstantReflectionProvider constantReflection) { - return new JVMCIBackend(metaAccess, codeCache, constantReflection); - } - - public String getJVMCIRuntimeName() { - return "basic"; - } -} diff -r e0b5d4fcd929 -r 2e8c01def9a5 graal/com.oracle.jvmci.hotspot.amd64/src/com/oracle/jvmci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.hotspot.amd64/src/com/oracle/jvmci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java Wed Jun 03 00:30:44 2015 +0200 @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.jvmci.hotspot.amd64; + +import static com.oracle.jvmci.hotspot.InitTimer.*; + +import java.util.*; + +import com.oracle.jvmci.amd64.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.hotspot.*; +import com.oracle.jvmci.meta.*; +import com.oracle.jvmci.runtime.*; +import com.oracle.jvmci.service.*; + +@ServiceProvider(HotSpotJVMCIBackendFactory.class) +public class AMD64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory { + + protected Architecture createArchitecture(HotSpotVMConfig config) { + return new AMD64(computeFeatures(config), computeFlags(config)); + } + + protected EnumSet computeFeatures(HotSpotVMConfig config) { + // Configure the feature set using the HotSpot flag settings. + EnumSet features = EnumSet.noneOf(AMD64.CPUFeature.class); + assert config.useSSE >= 2 : "minimum config for x64"; + features.add(AMD64.CPUFeature.SSE); + features.add(AMD64.CPUFeature.SSE2); + if ((config.x86CPUFeatures & config.cpuSSE3) != 0) { + features.add(AMD64.CPUFeature.SSE3); + } + if ((config.x86CPUFeatures & config.cpuSSSE3) != 0) { + features.add(AMD64.CPUFeature.SSSE3); + } + if ((config.x86CPUFeatures & config.cpuSSE4A) != 0) { + features.add(AMD64.CPUFeature.SSE4a); + } + if ((config.x86CPUFeatures & config.cpuSSE41) != 0) { + features.add(AMD64.CPUFeature.SSE4_1); + } + if ((config.x86CPUFeatures & config.cpuSSE42) != 0) { + features.add(AMD64.CPUFeature.SSE4_2); + } + if ((config.x86CPUFeatures & config.cpuAVX) != 0) { + features.add(AMD64.CPUFeature.AVX); + } + if ((config.x86CPUFeatures & config.cpuAVX2) != 0) { + features.add(AMD64.CPUFeature.AVX2); + } + if ((config.x86CPUFeatures & config.cpuERMS) != 0) { + features.add(AMD64.CPUFeature.ERMS); + } + if ((config.x86CPUFeatures & config.cpuLZCNT) != 0) { + features.add(AMD64.CPUFeature.LZCNT); + } + if ((config.x86CPUFeatures & config.cpuPOPCNT) != 0) { + features.add(AMD64.CPUFeature.POPCNT); + } + if ((config.x86CPUFeatures & config.cpuAES) != 0) { + features.add(AMD64.CPUFeature.AES); + } + if ((config.x86CPUFeatures & config.cpu3DNOWPREFETCH) != 0) { + features.add(AMD64.CPUFeature.AMD_3DNOW_PREFETCH); + } + if ((config.x86CPUFeatures & config.cpuBMI1) != 0) { + features.add(AMD64.CPUFeature.BMI1); + } + return features; + } + + protected EnumSet computeFlags(HotSpotVMConfig config) { + EnumSet flags = EnumSet.noneOf(AMD64.Flag.class); + if (config.useCountLeadingZerosInstruction) { + flags.add(AMD64.Flag.UseCountLeadingZerosInstruction); + } + if (config.useCountTrailingZerosInstruction) { + flags.add(AMD64.Flag.UseCountTrailingZerosInstruction); + } + return flags; + } + + protected TargetDescription createTarget(HotSpotVMConfig config) { + final int stackFrameAlignment = 16; + final int implicitNullCheckLimit = 4096; + final boolean inlineObjects = true; + return new HotSpotTargetDescription(createArchitecture(config), true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects); + } + + protected HotSpotConstantReflectionProvider createConstantReflection(HotSpotJVMCIRuntimeProvider runtime) { + return new HotSpotConstantReflectionProvider(runtime); + } + + protected RegisterConfig createRegisterConfig(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target) { + return new AMD64HotSpotRegisterConfig(target.arch, runtime.getConfig()); + } + + protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target, RegisterConfig regConfig) { + return new HotSpotCodeCacheProvider(runtime, runtime.getConfig(), target, regConfig); + } + + protected HotSpotMetaAccessProvider createMetaAccess(HotSpotJVMCIRuntimeProvider runtime) { + return new HotSpotMetaAccessProvider(runtime); + } + + public String getArchitecture() { + return "AMD64"; + } + + @Override + public String toString() { + return getJVMCIRuntimeName() + ":" + getArchitecture(); + } + + public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, JVMCIBackend host) { + + assert host == null; + TargetDescription target = createTarget(runtime.getConfig()); + + RegisterConfig regConfig; + HotSpotCodeCacheProvider codeCache; + ConstantReflectionProvider constantReflection; + HotSpotMetaAccessProvider metaAccess; + try (InitTimer t = timer("create providers")) { + try (InitTimer rt = timer("create MetaAccess provider")) { + metaAccess = createMetaAccess(runtime); + } + try (InitTimer rt = timer("create RegisterConfig")) { + regConfig = createRegisterConfig(runtime, target); + } + try (InitTimer rt = timer("create CodeCache provider")) { + codeCache = createCodeCache(runtime, target, regConfig); + } + try (InitTimer rt = timer("create ConstantReflection provider")) { + constantReflection = createConstantReflection(runtime); + } + } + try (InitTimer rt = timer("instantiate backend")) { + return createBackend(metaAccess, codeCache, constantReflection); + } + } + + protected JVMCIBackend createBackend(HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, ConstantReflectionProvider constantReflection) { + return new JVMCIBackend(metaAccess, codeCache, constantReflection); + } + + public String getJVMCIRuntimeName() { + return "basic"; + } +} diff -r e0b5d4fcd929 -r 2e8c01def9a5 graal/com.oracle.jvmci.hotspot.sparc/src/com/oracle/jvmci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.hotspot.sparc/src/com/oracle/jvmci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java Wed Jun 03 00:30:44 2015 +0200 @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.jvmci.hotspot.sparc; + +import static com.oracle.jvmci.hotspot.InitTimer.*; + +import java.util.*; + +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.hotspot.*; +import com.oracle.jvmci.runtime.*; +import com.oracle.jvmci.service.*; +import com.oracle.jvmci.sparc.*; +import com.oracle.jvmci.sparc.SPARC.CPUFeature; + +@ServiceProvider(HotSpotJVMCIBackendFactory.class) +public class SPARCHotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory { + + protected Architecture createArchitecture(HotSpotVMConfig config) { + return new SPARC(computeFeatures(config)); + } + + protected TargetDescription createTarget(HotSpotVMConfig config) { + final int stackFrameAlignment = 16; + final int implicitNullCheckLimit = 4096; + final boolean inlineObjects = true; + return new HotSpotTargetDescription(createArchitecture(config), true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects); + } + + protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target, RegisterConfig regConfig) { + return new HotSpotCodeCacheProvider(runtime, runtime.getConfig(), target, regConfig); + } + + protected EnumSet computeFeatures(HotSpotVMConfig config) { + EnumSet features = EnumSet.noneOf(CPUFeature.class); + if ((config.sparcFeatures & config.vis1Instructions) != 0) { + features.add(CPUFeature.VIS1); + } + if ((config.sparcFeatures & config.vis2Instructions) != 0) { + features.add(CPUFeature.VIS2); + } + if ((config.sparcFeatures & config.vis3Instructions) != 0) { + features.add(CPUFeature.VIS3); + } + if ((config.sparcFeatures & config.cbcondInstructions) != 0) { + features.add(CPUFeature.CBCOND); + } + return features; + } + + public String getArchitecture() { + return "SPARC"; + } + + @Override + public String toString() { + return getJVMCIRuntimeName() + ":" + getArchitecture(); + } + + public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, JVMCIBackend host) { + assert host == null; + TargetDescription target = createTarget(runtime.getConfig()); + + HotSpotMetaAccessProvider metaAccess = new HotSpotMetaAccessProvider(runtime); + RegisterConfig regConfig = new SPARCHotSpotRegisterConfig(target, runtime.getConfig()); + HotSpotCodeCacheProvider codeCache = createCodeCache(runtime, target, regConfig); + HotSpotConstantReflectionProvider constantReflection = new HotSpotConstantReflectionProvider(runtime); + try (InitTimer rt = timer("instantiate backend")) { + return createBackend(metaAccess, codeCache, constantReflection); + } + } + + protected JVMCIBackend createBackend(HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, HotSpotConstantReflectionProvider constantReflection) { + return new JVMCIBackend(metaAccess, codeCache, constantReflection); + } + + public String getJVMCIRuntimeName() { + return "basic"; + } +} diff -r e0b5d4fcd929 -r 2e8c01def9a5 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotJVMCIRuntime.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotJVMCIRuntime.java Tue Jun 02 23:29:27 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotJVMCIRuntime.java Wed Jun 03 00:30:44 2015 +0200 @@ -220,7 +220,12 @@ hostBackend = registerBackend(factory.createJVMCIBackend(this, null)); } - vmEventListener = Services.loadSingle(HotSpotVMEventListener.class, true); + HotSpotVMEventListener listener = Services.loadSingle(HotSpotVMEventListener.class, false); + if (listener == null) { + listener = new HotSpotVMEventListener() { + }; + } + vmEventListener = listener; } private JVMCIBackend registerBackend(JVMCIBackend backend) { diff -r e0b5d4fcd929 -r 2e8c01def9a5 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotVMEventListener.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotVMEventListener.java Tue Jun 02 23:29:27 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotVMEventListener.java Wed Jun 03 00:30:44 2015 +0200 @@ -29,17 +29,25 @@ /** * Notifies this client that HotSpot is running in CompileTheWorld mode and the JVMCI compiler * should now perform its version of CompileTheWorld. + * + * @param metaspaceMethod + * @param entryBCI + * @param jvmciEnv + * @param id */ - void compileMetaspaceMethod(long metaspaceMethod, int entryBCI, long jvmciEnv, int id); + default void compileMetaspaceMethod(long metaspaceMethod, int entryBCI, long jvmciEnv, int id) { + } /** * Notifies this client that HotSpot is running in CompileTheWorld mode and the JVMCI compiler * should now perform its version of CompileTheWorld. */ - void notifyCompileTheWorld() throws Throwable; + default void notifyCompileTheWorld() throws Throwable { + } /** * Notifies this client that the VM is shutting down. */ - void notifyShutdown(); + default void notifyShutdown() { + } } diff -r e0b5d4fcd929 -r 2e8c01def9a5 graal/com.oracle.jvmci.service/src/com/oracle/jvmci/service/Services.java --- a/graal/com.oracle.jvmci.service/src/com/oracle/jvmci/service/Services.java Tue Jun 02 23:29:27 2015 +0200 +++ b/graal/com.oracle.jvmci.service/src/com/oracle/jvmci/service/Services.java Wed Jun 03 00:30:44 2015 +0200 @@ -34,10 +34,23 @@ */ public class Services { + /** + * Determines whether to suppress the {@link NoClassDefFoundError} raised if a service + * implementation class specified in a {@code /jvmci/services/*} file is missing. + */ + private static final boolean SuppressNoClassDefFoundError = Boolean.getBoolean("jvmci.service.suppressNoClassDefFoundError"); + private static final ClassValue> cache = new ClassValue>() { @Override protected List computeValue(Class type) { - return Arrays.asList(getServiceImpls(type)); + try { + return Arrays.asList(getServiceImpls(type)); + } catch (NoClassDefFoundError e) { + if (SuppressNoClassDefFoundError) { + return Collections.emptyList(); + } + throw e; + } } }; diff -r e0b5d4fcd929 -r 2e8c01def9a5 mx/suite.py --- a/mx/suite.py Tue Jun 02 23:29:27 2015 +0200 +++ b/mx/suite.py Wed Jun 03 00:30:44 2015 +0200 @@ -1320,7 +1320,8 @@ "subDir" : "graal", "sourcesPath" : "build/jvmci-hotspot.src.zip", "dependencies" : [ - "com.oracle.jvmci.hotspot", + "com.oracle.jvmci.hotspot.amd64", + "com.oracle.jvmci.hotspot.sparc", "com.oracle.jvmci.hotspot.jfr", ], "distDependencies" : [