Mercurial > hg > graal-compiler
view graal/com.oracle.jvmci.hotspot.sparc/src/com/oracle/jvmci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java @ 21749:1a9b0cebd4ec
added counters for profile based type-check snippets that miss one of the profile types
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 05 Jun 2015 17:33:15 +0200 |
parents | 2e8c01def9a5 |
children |
line wrap: on
line source
/* * 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<CPUFeature> computeFeatures(HotSpotVMConfig config) { EnumSet<CPUFeature> 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"; } }