8216262: Remove develop flag DelayCompilationDuringStartup

Reviewed-by: kvn, thartmann
This commit is contained in:
Claes Redestad 2019-01-08 11:23:19 +01:00
parent aea92f008a
commit bd8f4a115c
9 changed files with 14 additions and 58 deletions

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -60,7 +60,7 @@ void AbstractInterpreter::initialize() {
if (PrintBytecodeHistogram) BytecodeHistogram::reset(); if (PrintBytecodeHistogram) BytecodeHistogram::reset();
if (PrintBytecodePairHistogram) BytecodePairHistogram::reset(); if (PrintBytecodePairHistogram) BytecodePairHistogram::reset();
InvocationCounter::reinitialize(DelayCompilationDuringStartup); InvocationCounter::reinitialize();
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -130,20 +130,11 @@ void InvocationCounter::def(State state, int init, Action action) {
_action[state] = action; _action[state] = action;
} }
address dummy_invocation_counter_overflow(const methodHandle& m, TRAPS) { void InvocationCounter::reinitialize() {
ShouldNotReachHere();
return NULL;
}
void InvocationCounter::reinitialize(bool delay_overflow) {
// define states // define states
guarantee((int)number_of_states <= (int)state_limit, "adjust number_of_state_bits"); guarantee((int)number_of_states <= (int)state_limit, "adjust number_of_state_bits");
def(wait_for_nothing, 0, do_nothing); def(wait_for_nothing, 0, do_nothing);
if (delay_overflow) { def(wait_for_compile, 0, do_decay);
def(wait_for_compile, 0, do_decay);
} else {
def(wait_for_compile, 0, dummy_invocation_counter_overflow);
}
InterpreterInvocationLimit = CompileThreshold << number_of_noncount_bits; InterpreterInvocationLimit = CompileThreshold << number_of_noncount_bits;
InterpreterProfileLimit = ((CompileThreshold * InterpreterProfilePercentage) / 100)<< number_of_noncount_bits; InterpreterProfileLimit = ((CompileThreshold * InterpreterProfilePercentage) / 100)<< number_of_noncount_bits;
@ -167,5 +158,5 @@ void InvocationCounter::reinitialize(bool delay_overflow) {
} }
void invocationCounter_init() { void invocationCounter_init() {
InvocationCounter::reinitialize(DelayCompilationDuringStartup); InvocationCounter::reinitialize();
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -127,7 +127,7 @@ class InvocationCounter {
// Miscellaneous // Miscellaneous
static ByteSize counter_offset() { return byte_offset_of(InvocationCounter, _counter); } static ByteSize counter_offset() { return byte_offset_of(InvocationCounter, _counter); }
static void reinitialize(bool delay_overflow); static void reinitialize();
private: private:
static int _init [number_of_states]; // the counter limits static int _init [number_of_states]; // the counter limits

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -54,10 +54,6 @@ void JVMCICompiler::initialize() {
} }
set_state(initialized); set_state(initialized);
// JVMCI is considered as application code so we need to
// stop the VM deferring compilation now.
CompilationPolicy::completed_vm_startup();
} }
void JVMCICompiler::bootstrap(TRAPS) { void JVMCICompiler::bootstrap(TRAPS) {

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012 Red Hat, Inc. * Copyright (c) 2012 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
@ -365,8 +365,6 @@ JNI_END
static bool first_time_FindClass = true;
DT_RETURN_MARK_DECL(FindClass, jclass DT_RETURN_MARK_DECL(FindClass, jclass
, HOTSPOT_JNI_FINDCLASS_RETURN(_ret_ref)); , HOTSPOT_JNI_FINDCLASS_RETURN(_ret_ref));
@ -378,10 +376,6 @@ JNI_ENTRY(jclass, jni_FindClass(JNIEnv *env, const char *name))
jclass result = NULL; jclass result = NULL;
DT_RETURN_MARK(FindClass, jclass, (const jclass&)result); DT_RETURN_MARK(FindClass, jclass, (const jclass&)result);
// Remember if we are the first invocation of jni_FindClass
bool first_time = first_time_FindClass;
first_time_FindClass = false;
// Sanity check the name: it cannot be null or larger than the maximum size // Sanity check the name: it cannot be null or larger than the maximum size
// name we can fit in the constant pool. // name we can fit in the constant pool.
if (name == NULL) { if (name == NULL) {
@ -434,13 +428,6 @@ JNI_ENTRY(jclass, jni_FindClass(JNIEnv *env, const char *name))
trace_class_resolution(java_lang_Class::as_Klass(JNIHandles::resolve_non_null(result))); trace_class_resolution(java_lang_Class::as_Klass(JNIHandles::resolve_non_null(result)));
} }
// If we were the first invocation of jni_FindClass, we enable compilation again
// rather than just allowing invocation counter to overflow and decay.
// Controlled by flag DelayCompilationDuringStartup.
if (first_time) {
CompilationPolicy::completed_vm_startup();
}
return result; return result;
JNI_END JNI_END

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -55,12 +55,9 @@
CompilationPolicy* CompilationPolicy::_policy; CompilationPolicy* CompilationPolicy::_policy;
elapsedTimer CompilationPolicy::_accumulated_time; elapsedTimer CompilationPolicy::_accumulated_time;
bool CompilationPolicy::_in_vm_startup;
// Determine compilation policy based on command line argument // Determine compilation policy based on command line argument
void compilationPolicy_init() { void compilationPolicy_init() {
CompilationPolicy::set_in_vm_startup(DelayCompilationDuringStartup);
switch(CompilationPolicyChoice) { switch(CompilationPolicyChoice) {
case 0: case 0:
CompilationPolicy::set_policy(new SimpleCompPolicy()); CompilationPolicy::set_policy(new SimpleCompPolicy());
@ -86,13 +83,6 @@ void compilationPolicy_init() {
CompilationPolicy::policy()->initialize(); CompilationPolicy::policy()->initialize();
} }
void CompilationPolicy::completed_vm_startup() {
if (TraceCompilationPolicy) {
tty->print("CompilationPolicy: completed vm startup.\n");
}
_in_vm_startup = false;
}
// Returns true if m must be compiled before executing it // Returns true if m must be compiled before executing it
// This is intended to force compiles for methods (usually for // This is intended to force compiles for methods (usually for
// debugging) that would otherwise be interpreted for some reason. // debugging) that would otherwise be interpreted for some reason.
@ -184,7 +174,7 @@ bool CompilationPolicy::can_be_osr_compiled(const methodHandle& m, int comp_leve
bool CompilationPolicy::is_compilation_enabled() { bool CompilationPolicy::is_compilation_enabled() {
// NOTE: CompileBroker::should_compile_new_jobs() checks for UseCompiler // NOTE: CompileBroker::should_compile_new_jobs() checks for UseCompiler
return !delay_compilation_during_startup() && CompileBroker::should_compile_new_jobs(); return CompileBroker::should_compile_new_jobs();
} }
CompileTask* CompilationPolicy::select_task_helper(CompileQueue* compile_queue) { CompileTask* CompilationPolicy::select_task_helper(CompileQueue* compile_queue) {

View file

@ -49,10 +49,6 @@ class CompilationPolicy : public CHeapObj<mtCompiler> {
static bool must_be_compiled(const methodHandle& m, int comp_level = CompLevel_all); static bool must_be_compiled(const methodHandle& m, int comp_level = CompLevel_all);
public: public:
static void set_in_vm_startup(bool in_vm_startup) { _in_vm_startup = in_vm_startup; }
static void completed_vm_startup();
static bool delay_compilation_during_startup() { return _in_vm_startup; }
// If m must_be_compiled then request a compilation from the CompileBroker. // If m must_be_compiled then request a compilation from the CompileBroker.
// This supports the -Xcomp option. // This supports the -Xcomp option.
static void compile_if_required(const methodHandle& m, TRAPS); static void compile_if_required(const methodHandle& m, TRAPS);

View file

@ -1330,10 +1330,6 @@ define_pd_global(uint64_t,MaxRAM, 1ULL*G);
develop(bool, TypeProfileCasts, true, \ develop(bool, TypeProfileCasts, true, \
"treat casts like calls for purposes of type profiling") \ "treat casts like calls for purposes of type profiling") \
\ \
develop(bool, DelayCompilationDuringStartup, true, \
"Delay invoking the compiler until main application class is " \
"loaded") \
\
develop(bool, FillDelaySlots, true, \ develop(bool, FillDelaySlots, true, \
"Fill delay slots (on SPARC only)") \ "Fill delay slots (on SPARC only)") \
\ \

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -872,7 +872,7 @@ CompLevel TieredThresholdPolicy::loop_event(Method* method, CompLevel cur_level,
} }
bool TieredThresholdPolicy::maybe_switch_to_aot(const methodHandle& mh, CompLevel cur_level, CompLevel next_level, JavaThread* thread) { bool TieredThresholdPolicy::maybe_switch_to_aot(const methodHandle& mh, CompLevel cur_level, CompLevel next_level, JavaThread* thread) {
if (UseAOT && !delay_compilation_during_startup()) { if (UseAOT) {
if (cur_level == CompLevel_full_profile || cur_level == CompLevel_none) { if (cur_level == CompLevel_full_profile || cur_level == CompLevel_none) {
// If the current level is full profile or interpreter and we're switching to any other level, // If the current level is full profile or interpreter and we're switching to any other level,
// activate the AOT code back first so that we won't waste time overprofiling. // activate the AOT code back first so that we won't waste time overprofiling.