< prev index next >

src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java

Print this page
rev 9941 : 8147432: JVMCI should report bailouts in PrintCompilation output


  21  * questions.
  22  */
  23 package jdk.vm.ci.hotspot;
  24 
  25 import static jdk.vm.ci.inittimer.InitTimer.timer;
  26 
  27 import java.io.IOException;
  28 import java.io.OutputStream;
  29 import java.io.PrintStream;
  30 import java.lang.reflect.Array;
  31 import java.lang.reflect.Field;
  32 import java.lang.reflect.Method;
  33 import java.lang.reflect.Modifier;
  34 import java.util.Collections;
  35 import java.util.HashMap;
  36 import java.util.Map;
  37 import java.util.Objects;
  38 import java.util.TreeMap;
  39 
  40 import jdk.vm.ci.code.Architecture;

  41 import jdk.vm.ci.code.CompilationResult;
  42 import jdk.vm.ci.code.InstalledCode;
  43 import jdk.vm.ci.common.JVMCIError;
  44 import jdk.vm.ci.inittimer.InitTimer;
  45 import jdk.vm.ci.meta.JVMCIMetaAccessContext;
  46 import jdk.vm.ci.meta.JavaKind;
  47 import jdk.vm.ci.meta.JavaType;
  48 import jdk.vm.ci.meta.ResolvedJavaType;
  49 import jdk.vm.ci.runtime.JVMCI;
  50 import jdk.vm.ci.runtime.JVMCIBackend;
  51 import jdk.vm.ci.runtime.JVMCICompiler;
  52 import jdk.vm.ci.services.Services;
  53 import jdk.internal.misc.VM;
  54 
  55 //JaCoCo Exclude
  56 
  57 /**
  58  * HotSpot implementation of a JVMCI runtime.
  59  *
  60  * The initialization of this class is very fragile since it's initialized both through


 310         return klass;
 311     }
 312 
 313     public JVMCIBackend getHostJVMCIBackend() {
 314         return hostBackend;
 315     }
 316 
 317     public <T extends Architecture> JVMCIBackend getJVMCIBackend(Class<T> arch) {
 318         assert arch != Architecture.class;
 319         return backends.get(arch);
 320     }
 321 
 322     public Map<Class<? extends Architecture>, JVMCIBackend> getJVMCIBackends() {
 323         return Collections.unmodifiableMap(backends);
 324     }
 325 
 326     /**
 327      * Called from the VM.
 328      */
 329     @SuppressWarnings({"unused"})
 330     private void compileMethod(HotSpotResolvedJavaMethod method, int entryBCI, long jvmciEnv, int id) {
 331         getCompiler().compileMethod(new HotSpotCompilationRequest(method, entryBCI, jvmciEnv, id));
 332     }
 333 
 334     /**
 335      * Shuts down the runtime.
 336      *
 337      * Called from the VM.
 338      */
 339     @SuppressWarnings({"unused"})
 340     private void shutdown() throws Exception {
 341         for (HotSpotVMEventListener vmEventListener : vmEventListeners) {
 342             vmEventListener.notifyShutdown();
 343         }
 344     }
 345 
 346     /**
 347      * Notify on successful install into the CodeCache.
 348      *
 349      * @param hotSpotCodeCacheProvider
 350      * @param installedCode
 351      * @param compResult




  21  * questions.
  22  */
  23 package jdk.vm.ci.hotspot;
  24 
  25 import static jdk.vm.ci.inittimer.InitTimer.timer;
  26 
  27 import java.io.IOException;
  28 import java.io.OutputStream;
  29 import java.io.PrintStream;
  30 import java.lang.reflect.Array;
  31 import java.lang.reflect.Field;
  32 import java.lang.reflect.Method;
  33 import java.lang.reflect.Modifier;
  34 import java.util.Collections;
  35 import java.util.HashMap;
  36 import java.util.Map;
  37 import java.util.Objects;
  38 import java.util.TreeMap;
  39 
  40 import jdk.vm.ci.code.Architecture;
  41 import jdk.vm.ci.code.CompilationRequestResult;
  42 import jdk.vm.ci.code.CompilationResult;
  43 import jdk.vm.ci.code.InstalledCode;
  44 import jdk.vm.ci.common.JVMCIError;
  45 import jdk.vm.ci.inittimer.InitTimer;
  46 import jdk.vm.ci.meta.JVMCIMetaAccessContext;
  47 import jdk.vm.ci.meta.JavaKind;
  48 import jdk.vm.ci.meta.JavaType;
  49 import jdk.vm.ci.meta.ResolvedJavaType;
  50 import jdk.vm.ci.runtime.JVMCI;
  51 import jdk.vm.ci.runtime.JVMCIBackend;
  52 import jdk.vm.ci.runtime.JVMCICompiler;
  53 import jdk.vm.ci.services.Services;
  54 import jdk.internal.misc.VM;
  55 
  56 //JaCoCo Exclude
  57 
  58 /**
  59  * HotSpot implementation of a JVMCI runtime.
  60  *
  61  * The initialization of this class is very fragile since it's initialized both through


 311         return klass;
 312     }
 313 
 314     public JVMCIBackend getHostJVMCIBackend() {
 315         return hostBackend;
 316     }
 317 
 318     public <T extends Architecture> JVMCIBackend getJVMCIBackend(Class<T> arch) {
 319         assert arch != Architecture.class;
 320         return backends.get(arch);
 321     }
 322 
 323     public Map<Class<? extends Architecture>, JVMCIBackend> getJVMCIBackends() {
 324         return Collections.unmodifiableMap(backends);
 325     }
 326 
 327     /**
 328      * Called from the VM.
 329      */
 330     @SuppressWarnings({"unused"})
 331     private CompilationRequestResult compileMethod(HotSpotResolvedJavaMethod method, int entryBCI, long jvmciEnv, int id) {
 332         return getCompiler().compileMethod(new HotSpotCompilationRequest(method, entryBCI, jvmciEnv, id));
 333     }
 334 
 335     /**
 336      * Shuts down the runtime.
 337      *
 338      * Called from the VM.
 339      */
 340     @SuppressWarnings({"unused"})
 341     private void shutdown() throws Exception {
 342         for (HotSpotVMEventListener vmEventListener : vmEventListeners) {
 343             vmEventListener.notifyShutdown();
 344         }
 345     }
 346 
 347     /**
 348      * Notify on successful install into the CodeCache.
 349      *
 350      * @param hotSpotCodeCacheProvider
 351      * @param installedCode
 352      * @param compResult


< prev index next >