changeset 49356:8bb47943a8dd

8199066: [JVMCI] EagerJVMCI option should also initialize the JVMCI compiler Reviewed-by: kvn
author dnsimon
date Tue, 06 Mar 2018 16:02:04 -0800
parents cebb0e943ab2
children 0b48f0aa79ec
files src/hotspot/share/jvmci/jvmciCompilerToVM.cpp src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp	Tue Mar 06 18:12:15 2018 -0500
+++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp	Tue Mar 06 16:02:04 2018 -0800
@@ -295,6 +295,7 @@
   NOT_PRODUCT(do_intx_flag(CompileTheWorldStopAt))                         \
   do_intx_flag(ContendedPaddingWidth)                                      \
   do_bool_flag(DontCompileHugeMethods)                                     \
+  do_bool_flag(EagerJVMCI)                                                 \
   do_bool_flag(EnableContended)                                            \
   do_intx_flag(FieldsAllocationStyle)                                      \
   do_bool_flag(FoldStableValues)                                           \
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java	Tue Mar 06 18:12:15 2018 -0500
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java	Tue Mar 06 16:02:04 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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
@@ -71,6 +71,12 @@
         static {
             try (InitTimer t = timer("HotSpotJVMCIRuntime.<init>")) {
                 instance = new HotSpotJVMCIRuntime();
+
+                // Can only do eager initialization of the JVMCI compiler
+                // once the singleton instance is available.
+                if (instance.config.getFlag("EagerJVMCI", Boolean.class)) {
+                    instance.getCompiler();
+                }
             }
         }
     }