< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntime.java

Print this page
rev 56282 : [mq]: graal
   1 /*
   2  * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */


  96  */
  97 public final class HotSpotGraalRuntime implements HotSpotGraalRuntimeProvider {
  98 
  99     private static final boolean IS_AOT = Boolean.parseBoolean(Services.getSavedProperties().get("com.oracle.graalvm.isaot"));
 100 
 101     private static boolean checkArrayIndexScaleInvariants(MetaAccessProvider metaAccess) {
 102         assert metaAccess.getArrayIndexScale(JavaKind.Byte) == 1;
 103         assert metaAccess.getArrayIndexScale(JavaKind.Boolean) == 1;
 104         assert metaAccess.getArrayIndexScale(JavaKind.Char) == 2;
 105         assert metaAccess.getArrayIndexScale(JavaKind.Short) == 2;
 106         assert metaAccess.getArrayIndexScale(JavaKind.Int) == 4;
 107         assert metaAccess.getArrayIndexScale(JavaKind.Long) == 8;
 108         assert metaAccess.getArrayIndexScale(JavaKind.Float) == 4;
 109         assert metaAccess.getArrayIndexScale(JavaKind.Double) == 8;
 110         return true;
 111     }
 112 
 113     private final String runtimeName;
 114     private final String compilerConfigurationName;
 115     private final HotSpotBackend hostBackend;





 116     private final GlobalMetrics metricValues = new GlobalMetrics();
 117     private final List<SnippetCounter.Group> snippetCounterGroups;
 118     private final HotSpotGC garbageCollector;
 119 
 120     private final EconomicMap<Class<? extends Architecture>, HotSpotBackend> backends = EconomicMap.create(Equivalence.IDENTITY);
 121 
 122     private final GraalHotSpotVMConfig config;
 123 
 124     /**
 125      * The options can be {@linkplain #setOptionValues(String[], String[]) updated} by external
 126      * interfaces such as JMX. This comes with the risk that inconsistencies can arise as an
 127      * {@link OptionValues} object can be cached by various parts of Graal instead of always
 128      * obtaining them from this object. However, concurrent updates are never lost.
 129      */
 130     private AtomicReference<OptionValues> optionsRef = new AtomicReference<>();
 131 
 132     private final DiagnosticsOutputDirectory outputDirectory;
 133     private final Map<ExceptionAction, Integer> compilationProblemsPerAction;
 134 
 135     /**


   1 /*
   2  * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */


  96  */
  97 public final class HotSpotGraalRuntime implements HotSpotGraalRuntimeProvider {
  98 
  99     private static final boolean IS_AOT = Boolean.parseBoolean(Services.getSavedProperties().get("com.oracle.graalvm.isaot"));
 100 
 101     private static boolean checkArrayIndexScaleInvariants(MetaAccessProvider metaAccess) {
 102         assert metaAccess.getArrayIndexScale(JavaKind.Byte) == 1;
 103         assert metaAccess.getArrayIndexScale(JavaKind.Boolean) == 1;
 104         assert metaAccess.getArrayIndexScale(JavaKind.Char) == 2;
 105         assert metaAccess.getArrayIndexScale(JavaKind.Short) == 2;
 106         assert metaAccess.getArrayIndexScale(JavaKind.Int) == 4;
 107         assert metaAccess.getArrayIndexScale(JavaKind.Long) == 8;
 108         assert metaAccess.getArrayIndexScale(JavaKind.Float) == 4;
 109         assert metaAccess.getArrayIndexScale(JavaKind.Double) == 8;
 110         return true;
 111     }
 112 
 113     private final String runtimeName;
 114     private final String compilerConfigurationName;
 115     private final HotSpotBackend hostBackend;
 116 
 117     public GlobalMetrics getMetricValues() {
 118         return metricValues;
 119     }
 120 
 121     private final GlobalMetrics metricValues = new GlobalMetrics();
 122     private final List<SnippetCounter.Group> snippetCounterGroups;
 123     private final HotSpotGC garbageCollector;
 124 
 125     private final EconomicMap<Class<? extends Architecture>, HotSpotBackend> backends = EconomicMap.create(Equivalence.IDENTITY);
 126 
 127     private final GraalHotSpotVMConfig config;
 128 
 129     /**
 130      * The options can be {@linkplain #setOptionValues(String[], String[]) updated} by external
 131      * interfaces such as JMX. This comes with the risk that inconsistencies can arise as an
 132      * {@link OptionValues} object can be cached by various parts of Graal instead of always
 133      * obtaining them from this object. However, concurrent updates are never lost.
 134      */
 135     private AtomicReference<OptionValues> optionsRef = new AtomicReference<>();
 136 
 137     private final DiagnosticsOutputDirectory outputDirectory;
 138     private final Map<ExceptionAction, Integer> compilationProblemsPerAction;
 139 
 140     /**


< prev index next >