use of jdk.vm.ci.code.Architecture in project graal by oracle.
the class SPARCAssemblerTest method createTarget.
private static TargetDescription createTarget() {
final int stackFrameAlignment = 16;
final int implicitNullCheckLimit = 4096;
final boolean inlineObjects = true;
Architecture arch = new SPARC(computeFeatures());
return new TargetDescription(arch, true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects);
}
use of jdk.vm.ci.code.Architecture in project graal by oracle.
the class NativeImageGenerator method createTarget.
public static TargetDescription createTarget(Platform platform) {
if (includedIn(platform, Platform.AMD64.class)) {
Architecture architecture;
if (NativeImageOptions.NativeArchitecture.getValue()) {
architecture = GraalAccess.getOriginalTarget().arch;
} else {
EnumSet<AMD64.CPUFeature> features = EnumSet.noneOf(AMD64.CPUFeature.class);
// SSE and SSE2 are added by defaults as they are required by Graal
features.add(AMD64.CPUFeature.SSE);
features.add(AMD64.CPUFeature.SSE2);
features.addAll(parseCSVtoEnum(AMD64.CPUFeature.class, NativeImageOptions.CPUFeatures.getValue()));
architecture = new AMD64(features, SubstrateTargetDescription.allFlags());
}
assert architecture instanceof AMD64 : "SVM supports only AMD64 architectures.";
return new SubstrateTargetDescription(architecture, true, 16, 0, false);
} else {
throw UserError.abort("Architecture specified by platform is not supported: " + platform.getClass().getTypeName());
}
}
use of jdk.vm.ci.code.Architecture in project graal by oracle.
the class BitOpNodesTest method testBitCountLong.
@Test
public void testBitCountLong() {
Architecture arch = getBackend().getTarget().arch;
boolean isAmd64WithPopCount = arch instanceof AMD64 && ((AMD64) arch).getFeatures().contains(AMD64.CPUFeature.POPCNT);
boolean isSparc = arch instanceof SPARC;
Assume.assumeTrue("Only works on hardware with popcnt at the moment", isAmd64WithPopCount || isSparc);
ValueNode result = parseAndInline("bitCountLongSnippet");
Assert.assertEquals(StampFactory.forInteger(JavaKind.Int, 8, 40), result.stamp(NodeView.DEFAULT));
}
use of jdk.vm.ci.code.Architecture in project graal by oracle.
the class AArch64MacroAssemblerTest method createTarget.
private static TargetDescription createTarget() {
final int stackFrameAlignment = 16;
final int implicitNullCheckLimit = 4096;
final boolean inlineObjects = true;
Architecture arch = new AArch64(computeFeatures(), computeFlags());
return new TargetDescription(arch, true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects);
}
use of jdk.vm.ci.code.Architecture in project graal by oracle.
the class JavaMainWrapper method run.
@CEntryPoint
@CEntryPointOptions(prologue = EnterCreateIsolatePrologue.class, include = CEntryPointOptions.NotIncludedAutomatically.class)
public static int run(int paramArgc, CCharPointerPointer paramArgv) throws Exception {
JavaThreads.singleton().assignJavaThread(preallocatedThread, true);
JavaMainWrapper.argc = paramArgc;
JavaMainWrapper.argv = paramArgv;
Architecture imageArchitecture = ImageSingletons.lookup(TargetDescription.class).arch;
AMD64CPUFeatureAccess.verifyHostSupportsArchitecture(imageArchitecture);
String[] args = SubstrateUtil.getArgs(paramArgc, paramArgv);
if (SubstrateOptions.ParseRuntimeOptions.getValue()) {
args = RuntimeOptionParser.singleton().parse(args, DEFAULT_OPTION_PREFIX, PLUS_MINUS, true);
args = RuntimeOptionParser.singleton().parse(args, GRAAL_OPTION_PREFIX, NAME_VALUE, true);
args = XOptions.singleton().parse(args);
args = RuntimePropertyParser.parse(args);
}
mainArgs = args;
try {
final RuntimeSupport rs = RuntimeSupport.getRuntimeSupport();
if (AllocationSite.Options.AllocationProfiling.getValue()) {
rs.addShutdownHook(new AllocationSite.AllocationProfilingShutdownHook());
}
if (SubstrateOptions.PrintGCSummary.getValue()) {
rs.addShutdownHook(new PrintGCSummaryShutdownHook());
}
try {
JavaMainSupport.executeStartupHooks();
ImageSingletons.lookup(JavaMainSupport.class).getJavaMainMethod().invoke(null, (Object) mainArgs);
} finally {
// always execute the shutdown hooks
JavaMainSupport.executeShutdownHooks();
}
} catch (Throwable ex) {
SnippetRuntime.reportUnhandledExceptionJava(ex);
}
JavaThreads.singleton().joinAllNonDaemons();
Counter.logValues();
return 0;
}
Aggregations