8199066: [JVMCI] EagerJVMCI option should also initialize the JVMCI compiler
Reviewed-by: kvn
--- 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();
+ }
}
}
}