8144964: JVMCI compilations need to be disabled until the module system is initialized

Reviewed-by: kvn
This commit is contained in:
Christian Thalinger 2016-03-31 15:52:07 -10:00
parent b75d50cc75
commit 879c8b43c6
6 changed files with 45 additions and 13 deletions

View file

@ -386,13 +386,16 @@ CompileTask* CompileQueue::get() {
task = CompilationPolicy::policy()->select_task(this);
}
// Save method pointers across unlock safepoint. The task is removed from
// the compilation queue, which is walked during RedefineClasses.
save_method = methodHandle(task->method());
save_hot_method = methodHandle(task->hot_method());
if (task != NULL) {
// Save method pointers across unlock safepoint. The task is removed from
// the compilation queue, which is walked during RedefineClasses.
save_method = methodHandle(task->method());
save_hot_method = methodHandle(task->hot_method());
remove(task);
purge_stale_tasks(); // may temporarily release MCQ lock
}
remove(task);
purge_stale_tasks(); // may temporarily release MCQ lock
return task;
}
@ -1781,7 +1784,8 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
bool is_osr = (osr_bci != standard_entry_bci);
bool should_log = (thread->log() != NULL);
bool should_break = false;
int task_level = task->comp_level();
const int task_level = task->comp_level();
AbstractCompiler* comp = task->compiler();
DirectiveSet* directive;
{
@ -1793,7 +1797,7 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
assert(!method->is_native(), "no longer compile natives");
// Look up matching directives
directive = DirectivesStack::getMatchingDirective(method, compiler(task_level));
directive = DirectivesStack::getMatchingDirective(method, comp);
// Save information about this method in case of failure.
set_last_compile(thread, method, is_osr, task_level);
@ -1812,13 +1816,13 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
int compilable = ciEnv::MethodCompilable;
const char* failure_reason = NULL;
const char* retry_message = NULL;
AbstractCompiler *comp = compiler(task_level);
int system_dictionary_modification_counter;
{
MutexLocker locker(Compile_lock, thread);
system_dictionary_modification_counter = SystemDictionary::number_of_modifications();
}
#if INCLUDE_JVMCI
if (UseJVMCICompiler && comp != NULL && comp->is_jvmci()) {
JVMCICompiler* jvmci = (JVMCICompiler*) comp;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2016, 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
@ -122,6 +122,13 @@ void CompileTask::initialize(int compile_id,
_next = NULL;
}
/**
* Returns the compiler for this task.
*/
AbstractCompiler* CompileTask::compiler() {
return CompileBroker::compiler(_comp_level);
}
// ------------------------------------------------------------------
// CompileTask::code/set_code
//

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2016, 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
@ -115,6 +115,8 @@ class CompileTask : public CHeapObj<mtCompiler> {
int comp_level() { return _comp_level;}
void set_comp_level(int comp_level) { _comp_level = comp_level;}
AbstractCompiler* compiler();
int num_inlined_bytecodes() const { return _num_inlined_bytecodes; }
void set_num_inlined_bytecodes(int n) { _num_inlined_bytecodes = n; }