/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "ci/compilerInterface.hpp"
#include "compiler/abstractCompiler.hpp"
#include "runtime/perfData.hpp"
class nmethod;
class nmethodLocker;
// CompileTask
//
// An entry in the compile queue. It represents a pending or current
// compilation.
friend class VMStructs;
private:
int _osr_bci;
bool _is_complete;
bool _is_success;
bool _is_blocking;
int _comp_level;
// Fields used for logging why the compilation was initiated:
public:
CompileTask() {
}
bool is_blocking);
void free();
private:
static void print_compilation_impl(outputStream* st, methodOop method, int compile_id, int comp_level,
public:
static void print_compilation(outputStream* st, const nmethod* nm, const char* msg = NULL, bool short_form = false) {
msg, short_form);
}
static void print_inlining(outputStream* st, ciMethod* method, int inline_level, int bci, const char* msg = NULL);
}
void print();
void print_line();
void log_task_queued();
};
// CompilerCounters
//
// Per Compiler Performance Counters.
//
public:
enum {
};
private:
int _compile_type;
public:
// these methods should be called in a thread safe context
}
}
};
// CompileQueue
//
// A list of CompileTasks.
private:
const char* _name;
int _size;
public:
_size = 0;
}
CompileTask* get();
void print();
};
// CompileTaskWrapper
//
// Assign this task to the current thread. Deallocate the task
// when the compilation is complete.
public:
};
// Compilation
//
// The broker for all compilation requests.
friend class Threads;
friend class CompileTaskWrapper;
public:
enum {
};
// Compile type Information for print_last_compile() and CompilerCounters
private:
static bool _initialized;
static volatile bool _should_block;
// This flag can be used to stop compilation or turn it back on
// The installed compiler(s)
// These counters are used for assigning id's to each compilation
static int _last_compile_type;
static int _last_compile_level;
// performance counters
// Timers and counters for generating statistics
static int _total_compile_count;
static int _total_bailout_count;
static int _total_invalidated_count;
static int _total_native_compile_count;
static int _total_osr_compile_count;
static int _total_standard_compile_count;
static int _sum_osr_bytes_compiled;
static int _sum_standard_bytes_compiled;
static int _sum_nmethod_size;
static int _sum_nmethod_code_size;
static long _peak_compilation_time;
static CompilerThread* make_compiler_thread(const char* name, CompileQueue* queue, CompilerCounters* counters, TRAPS);
int compile_id,
int osr_bci,
int comp_level,
int hot_count,
const char* comment,
bool blocking);
static CompileTask* allocate_task();
static void set_last_compile(CompilerThread *thread, methodHandle method, bool is_osr, int comp_level);
static void push_jni_handle_block();
static void pop_jni_handle_block();
int osr_bci,
int comp_level,
int hot_count,
const char* comment,
return NULL;
}
public:
enum {
// The entry bci used for non-OSR compilations.
};
return NULL;
}
}
static void compilation_init();
static void init_compiler_thread_log();
int osr_bci,
int comp_level,
int hot_count,
static void compiler_thread_loop();
static bool is_idle();
// Set _should_block.
// Call this from the VM, with Threads_lock held and a safepoint requested.
static void set_should_block();
// Call this from the compiler at convenient points, to poll for _should_block.
static void maybe_block();
enum {
// Flags for toggling compiler activity
stop_compilation = 0,
};
static bool should_compile_new_jobs() { return UseCompiler && (_should_compile_new_jobs == run_compilation); }
// Return success if the current caller set it
}
static void handle_full_code_cache();
// Return total compilation ticks
}
// Print a detailed accounting of compilation time
static void print_times();
// Debugging output for failure
static void print_last_compile();
};
#endif // SHARE_VM_COMPILER_COMPILEBROKER_HPP