2007-12-01 00:00:00 +00:00
|
|
|
/*
|
2018-03-26 12:59:45 -07:00
|
|
|
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
|
2007-12-01 00:00:00 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
*
|
|
|
|
* This code is free software; you can redistribute it and/or modify it
|
|
|
|
* 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.
|
|
|
|
*
|
2010-05-27 19:08:38 -07:00
|
|
|
* 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.
|
2007-12-01 00:00:00 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2010-11-23 13:22:55 -08:00
|
|
|
#ifndef SHARE_VM_COMPILER_COMPILEBROKER_HPP
|
|
|
|
#define SHARE_VM_COMPILER_COMPILEBROKER_HPP
|
|
|
|
|
|
|
|
#include "ci/compilerInterface.hpp"
|
|
|
|
#include "compiler/abstractCompiler.hpp"
|
2015-09-04 12:47:57 +02:00
|
|
|
#include "compiler/compileTask.hpp"
|
2015-10-20 18:07:28 +02:00
|
|
|
#include "compiler/compilerDirectives.hpp"
|
2010-11-23 13:22:55 -08:00
|
|
|
#include "runtime/perfData.hpp"
|
2015-10-20 18:07:28 +02:00
|
|
|
#include "utilities/stack.hpp"
|
2016-02-08 18:52:03 +01:00
|
|
|
#if INCLUDE_JVMCI
|
|
|
|
#include "jvmci/jvmciCompiler.hpp"
|
|
|
|
#endif
|
2010-11-23 13:22:55 -08:00
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
class nmethod;
|
|
|
|
class nmethodLocker;
|
|
|
|
|
|
|
|
// CompilerCounters
|
|
|
|
//
|
|
|
|
// Per Compiler Performance Counters.
|
|
|
|
//
|
2012-06-28 17:03:16 -04:00
|
|
|
class CompilerCounters : public CHeapObj<mtCompiler> {
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
enum {
|
|
|
|
cmname_buffer_length = 160
|
|
|
|
};
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
char _current_method[cmname_buffer_length];
|
|
|
|
int _compile_type;
|
|
|
|
|
|
|
|
public:
|
2015-10-12 14:54:39 +02:00
|
|
|
CompilerCounters();
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
// these methods should be called in a thread safe context
|
|
|
|
|
|
|
|
void set_current_method(const char* method) {
|
2015-04-07 14:19:03 +02:00
|
|
|
strncpy(_current_method, method, (size_t)cmname_buffer_length-1);
|
|
|
|
_current_method[cmname_buffer_length-1] = '\0';
|
2007-12-01 00:00:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
char* current_method() { return _current_method; }
|
|
|
|
|
|
|
|
void set_compile_type(int compile_type) {
|
|
|
|
_compile_type = compile_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
int compile_type() { return _compile_type; }
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
// CompileQueue
|
|
|
|
//
|
|
|
|
// A list of CompileTasks.
|
2012-06-28 17:03:16 -04:00
|
|
|
class CompileQueue : public CHeapObj<mtCompiler> {
|
2007-12-01 00:00:00 +00:00
|
|
|
private:
|
|
|
|
const char* _name;
|
|
|
|
|
|
|
|
CompileTask* _first;
|
|
|
|
CompileTask* _last;
|
|
|
|
|
2014-03-11 15:06:34 +04:00
|
|
|
CompileTask* _first_stale;
|
|
|
|
|
2010-09-03 17:51:07 -07:00
|
|
|
int _size;
|
2014-03-11 15:06:34 +04:00
|
|
|
|
|
|
|
void purge_stale_tasks();
|
2007-12-01 00:00:00 +00:00
|
|
|
public:
|
2014-11-13 14:42:54 +01:00
|
|
|
CompileQueue(const char* name) {
|
2007-12-01 00:00:00 +00:00
|
|
|
_name = name;
|
|
|
|
_first = NULL;
|
|
|
|
_last = NULL;
|
2010-09-03 17:51:07 -07:00
|
|
|
_size = 0;
|
2014-03-11 15:06:34 +04:00
|
|
|
_first_stale = NULL;
|
2007-12-01 00:00:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const char* name() const { return _name; }
|
|
|
|
|
|
|
|
void add(CompileTask* task);
|
2010-09-03 17:51:07 -07:00
|
|
|
void remove(CompileTask* task);
|
2014-03-11 15:06:34 +04:00
|
|
|
void remove_and_mark_stale(CompileTask* task);
|
2010-09-03 17:51:07 -07:00
|
|
|
CompileTask* first() { return _first; }
|
|
|
|
CompileTask* last() { return _last; }
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
CompileTask* get();
|
|
|
|
|
|
|
|
bool is_empty() const { return _first == NULL; }
|
2010-09-03 17:51:07 -07:00
|
|
|
int size() const { return _size; }
|
2007-12-01 00:00:00 +00:00
|
|
|
|
2014-03-11 15:06:34 +04:00
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
// Redefine Classes support
|
|
|
|
void mark_on_stack();
|
2014-04-29 07:59:22 +02:00
|
|
|
void free_all();
|
2014-09-10 13:27:33 +02:00
|
|
|
void print_tty();
|
|
|
|
void print(outputStream* st = tty);
|
2013-10-10 15:44:12 +02:00
|
|
|
|
|
|
|
~CompileQueue() {
|
|
|
|
assert (is_empty(), " Compile Queue must be empty");
|
|
|
|
}
|
2007-12-01 00:00:00 +00:00
|
|
|
};
|
|
|
|
|
2010-09-03 17:51:07 -07:00
|
|
|
// CompileTaskWrapper
|
|
|
|
//
|
|
|
|
// Assign this task to the current thread. Deallocate the task
|
|
|
|
// when the compilation is complete.
|
|
|
|
class CompileTaskWrapper : StackObj {
|
|
|
|
public:
|
|
|
|
CompileTaskWrapper(CompileTask* task);
|
|
|
|
~CompileTaskWrapper();
|
|
|
|
};
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// Compilation
|
|
|
|
//
|
|
|
|
// The broker for all compilation requests.
|
|
|
|
class CompileBroker: AllStatic {
|
|
|
|
friend class Threads;
|
2015-10-20 18:07:28 +02:00
|
|
|
friend class CompileTaskWrapper;
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
enum {
|
|
|
|
name_buffer_length = 100
|
|
|
|
};
|
|
|
|
|
|
|
|
// Compile type Information for print_last_compile() and CompilerCounters
|
|
|
|
enum { no_compile, normal_compile, osr_compile, native_compile };
|
2015-10-23 16:48:38 -04:00
|
|
|
static int assign_compile_id (const methodHandle& method, int osr_bci);
|
2014-01-10 06:36:18 +01:00
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
static bool _initialized;
|
|
|
|
static volatile bool _should_block;
|
|
|
|
|
2010-01-29 09:27:22 -08:00
|
|
|
// This flag can be used to stop compilation or turn it back on
|
|
|
|
static volatile jint _should_compile_new_jobs;
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// The installed compiler(s)
|
|
|
|
static AbstractCompiler* _compilers[2];
|
|
|
|
|
2018-04-18 11:19:32 +02:00
|
|
|
// The maximum numbers of compiler threads to be determined during startup.
|
|
|
|
static int _c1_count, _c2_count;
|
|
|
|
|
|
|
|
// An array of compiler thread Java objects
|
|
|
|
static jobject *_compiler1_objects, *_compiler2_objects;
|
|
|
|
|
|
|
|
// An array of compiler logs
|
|
|
|
static CompileLog **_compiler1_logs, **_compiler2_logs;
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// These counters are used for assigning id's to each compilation
|
2014-01-10 06:36:18 +01:00
|
|
|
static volatile jint _compilation_id;
|
|
|
|
static volatile jint _osr_compilation_id;
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
static int _last_compile_type;
|
|
|
|
static int _last_compile_level;
|
|
|
|
static char _last_method_compiled[name_buffer_length];
|
|
|
|
|
2014-04-29 07:59:22 +02:00
|
|
|
static CompileQueue* _c2_compile_queue;
|
|
|
|
static CompileQueue* _c1_compile_queue;
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
// performance counters
|
|
|
|
static PerfCounter* _perf_total_compilation;
|
|
|
|
static PerfCounter* _perf_native_compilation;
|
|
|
|
static PerfCounter* _perf_osr_compilation;
|
|
|
|
static PerfCounter* _perf_standard_compilation;
|
|
|
|
|
|
|
|
static PerfCounter* _perf_total_bailout_count;
|
|
|
|
static PerfCounter* _perf_total_invalidated_count;
|
|
|
|
static PerfCounter* _perf_total_compile_count;
|
|
|
|
static PerfCounter* _perf_total_native_compile_count;
|
|
|
|
static PerfCounter* _perf_total_osr_compile_count;
|
|
|
|
static PerfCounter* _perf_total_standard_compile_count;
|
|
|
|
|
|
|
|
static PerfCounter* _perf_sum_osr_bytes_compiled;
|
|
|
|
static PerfCounter* _perf_sum_standard_bytes_compiled;
|
|
|
|
static PerfCounter* _perf_sum_nmethod_size;
|
|
|
|
static PerfCounter* _perf_sum_nmethod_code_size;
|
|
|
|
|
|
|
|
static PerfStringVariable* _perf_last_method;
|
|
|
|
static PerfStringVariable* _perf_last_failed_method;
|
|
|
|
static PerfStringVariable* _perf_last_invalidated_method;
|
|
|
|
static PerfVariable* _perf_last_compile_type;
|
|
|
|
static PerfVariable* _perf_last_compile_size;
|
|
|
|
static PerfVariable* _perf_last_failed_type;
|
|
|
|
static PerfVariable* _perf_last_invalidated_type;
|
|
|
|
|
|
|
|
// Timers and counters for generating statistics
|
|
|
|
static elapsedTimer _t_total_compilation;
|
|
|
|
static elapsedTimer _t_osr_compilation;
|
|
|
|
static elapsedTimer _t_standard_compilation;
|
2014-09-25 12:10:57 +04:00
|
|
|
static elapsedTimer _t_invalidated_compilation;
|
|
|
|
static elapsedTimer _t_bailedout_compilation;
|
2007-12-01 00:00:00 +00:00
|
|
|
|
2013-06-10 11:30:51 +02:00
|
|
|
static int _total_compile_count;
|
2007-12-01 00:00:00 +00:00
|
|
|
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;
|
2018-05-30 14:46:17 +02:00
|
|
|
static int _total_compiler_stopped_count;
|
|
|
|
static int _total_compiler_restarted_count;
|
2007-12-01 00:00:00 +00:00
|
|
|
static int _sum_osr_bytes_compiled;
|
|
|
|
static int _sum_standard_bytes_compiled;
|
|
|
|
static int _sum_nmethod_size;
|
|
|
|
static int _sum_nmethod_code_size;
|
2013-06-10 11:30:51 +02:00
|
|
|
static long _peak_compilation_time;
|
2007-12-01 00:00:00 +00:00
|
|
|
|
2017-10-31 11:55:09 -04:00
|
|
|
static volatile int _print_compilation_warning;
|
2013-11-12 09:32:50 +01:00
|
|
|
|
2018-04-18 11:19:32 +02:00
|
|
|
static Handle create_thread_oop(const char* name, TRAPS);
|
2018-11-01 14:15:35 +01:00
|
|
|
static JavaThread* make_thread(jobject thread_oop, CompileQueue* queue, AbstractCompiler* comp, TRAPS);
|
2018-04-18 11:19:32 +02:00
|
|
|
static void init_compiler_sweeper_threads();
|
|
|
|
static void possibly_add_compiler_threads();
|
2015-10-23 16:48:38 -04:00
|
|
|
static bool compilation_is_complete (const methodHandle& method, int osr_bci, int comp_level);
|
2016-03-03 16:21:16 +01:00
|
|
|
static bool compilation_is_prohibited(const methodHandle& method, int osr_bci, int comp_level, bool excluded);
|
2015-10-23 16:48:38 -04:00
|
|
|
static void preload_classes (const methodHandle& method, TRAPS);
|
2007-12-01 00:00:00 +00:00
|
|
|
|
2015-11-05 19:31:57 +01:00
|
|
|
static CompileTask* create_compile_task(CompileQueue* queue,
|
|
|
|
int compile_id,
|
|
|
|
const methodHandle& method,
|
|
|
|
int osr_bci,
|
|
|
|
int comp_level,
|
|
|
|
const methodHandle& hot_method,
|
|
|
|
int hot_count,
|
2016-04-13 14:48:22 +02:00
|
|
|
CompileTask::CompileReason compile_reason,
|
2015-11-05 19:31:57 +01:00
|
|
|
bool blocking);
|
2007-12-01 00:00:00 +00:00
|
|
|
static void wait_for_completion(CompileTask* task);
|
2016-01-11 14:23:35 +01:00
|
|
|
#if INCLUDE_JVMCI
|
2016-02-08 18:52:03 +01:00
|
|
|
static bool wait_for_jvmci_completion(JVMCICompiler* comp, CompileTask* task, JavaThread* thread);
|
2016-01-11 14:23:35 +01:00
|
|
|
#endif
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
static void invoke_compiler_on_method(CompileTask* task);
|
2018-11-19 11:51:27 +01:00
|
|
|
static void post_compile(CompilerThread* thread, CompileTask* task, bool success, ciEnv* ci_env,
|
|
|
|
int compilable, const char* failure_reason);
|
2015-10-23 16:48:38 -04:00
|
|
|
static void set_last_compile(CompilerThread *thread, const methodHandle& method, bool is_osr, int comp_level);
|
2007-12-01 00:00:00 +00:00
|
|
|
static void push_jni_handle_block();
|
|
|
|
static void pop_jni_handle_block();
|
|
|
|
static void collect_statistics(CompilerThread* thread, elapsedTimer time, CompileTask* task);
|
|
|
|
|
2015-10-23 16:48:38 -04:00
|
|
|
static void compile_method_base(const methodHandle& method,
|
2007-12-01 00:00:00 +00:00
|
|
|
int osr_bci,
|
|
|
|
int comp_level,
|
2015-10-23 16:48:38 -04:00
|
|
|
const methodHandle& hot_method,
|
2007-12-01 00:00:00 +00:00
|
|
|
int hot_count,
|
2016-04-13 14:48:22 +02:00
|
|
|
CompileTask::CompileReason compile_reason,
|
2016-03-03 16:21:16 +01:00
|
|
|
bool blocking,
|
2012-01-26 12:15:24 -08:00
|
|
|
Thread* thread);
|
2014-09-10 13:27:33 +02:00
|
|
|
|
|
|
|
static CompileQueue* compile_queue(int comp_level);
|
2013-10-10 15:44:12 +02:00
|
|
|
static bool init_compiler_runtime();
|
|
|
|
static void shutdown_compiler_runtime(AbstractCompiler* comp, CompilerThread* thread);
|
|
|
|
|
2015-10-20 18:07:28 +02:00
|
|
|
public:
|
|
|
|
|
|
|
|
static DirectivesStack* dirstack();
|
|
|
|
static void set_dirstack(DirectivesStack* stack);
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
enum {
|
|
|
|
// The entry bci used for non-OSR compilations.
|
|
|
|
standard_entry_bci = InvocationEntryBci
|
|
|
|
};
|
|
|
|
|
2010-09-03 17:51:07 -07:00
|
|
|
static AbstractCompiler* compiler(int comp_level) {
|
|
|
|
if (is_c2_compile(comp_level)) return _compilers[1]; // C2
|
|
|
|
if (is_c1_compile(comp_level)) return _compilers[0]; // C1
|
|
|
|
return NULL;
|
2007-12-01 00:00:00 +00:00
|
|
|
}
|
|
|
|
|
2015-10-23 16:48:38 -04:00
|
|
|
static bool compilation_is_in_queue(const methodHandle& method);
|
2014-09-10 13:27:33 +02:00
|
|
|
static void print_compile_queues(outputStream* st);
|
2015-10-20 18:07:28 +02:00
|
|
|
static void print_directives(outputStream* st);
|
2010-09-03 17:51:07 -07:00
|
|
|
static int queue_size(int comp_level) {
|
|
|
|
CompileQueue *q = compile_queue(comp_level);
|
|
|
|
return q != NULL ? q->size() : 0;
|
|
|
|
}
|
2018-03-27 11:51:39 +02:00
|
|
|
static void compilation_init_phase1(TRAPS);
|
|
|
|
static void compilation_init_phase2();
|
2007-12-01 00:00:00 +00:00
|
|
|
static void init_compiler_thread_log();
|
2015-10-23 16:48:38 -04:00
|
|
|
static nmethod* compile_method(const methodHandle& method,
|
2010-09-03 17:51:07 -07:00
|
|
|
int osr_bci,
|
|
|
|
int comp_level,
|
2015-10-23 16:48:38 -04:00
|
|
|
const methodHandle& hot_method,
|
2010-09-03 17:51:07 -07:00
|
|
|
int hot_count,
|
2016-04-13 14:48:22 +02:00
|
|
|
CompileTask::CompileReason compile_reason,
|
|
|
|
Thread* thread);
|
2007-12-01 00:00:00 +00:00
|
|
|
|
2016-03-03 16:21:16 +01:00
|
|
|
static nmethod* compile_method(const methodHandle& method,
|
|
|
|
int osr_bci,
|
|
|
|
int comp_level,
|
|
|
|
const methodHandle& hot_method,
|
|
|
|
int hot_count,
|
2016-04-13 14:48:22 +02:00
|
|
|
CompileTask::CompileReason compile_reason,
|
2016-03-03 16:21:16 +01:00
|
|
|
DirectiveSet* directive,
|
|
|
|
Thread* thread);
|
|
|
|
|
2015-10-08 12:49:30 -10:00
|
|
|
// Acquire any needed locks and assign a compile id
|
2015-10-23 16:48:38 -04:00
|
|
|
static uint assign_compile_id_unlocked(Thread* thread, const methodHandle& method, int osr_bci);
|
2015-10-08 12:49:30 -10:00
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
static void compiler_thread_loop();
|
2010-01-29 09:27:22 -08:00
|
|
|
static uint get_compilation_id() { return _compilation_id; }
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
// 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();
|
|
|
|
|
2017-07-12 09:49:05 +02:00
|
|
|
enum CompilerActivity {
|
2010-01-29 09:27:22 -08:00
|
|
|
// Flags for toggling compiler activity
|
2017-07-12 09:49:05 +02:00
|
|
|
stop_compilation = 0,
|
|
|
|
run_compilation = 1,
|
|
|
|
shutdown_compilation = 2
|
2010-01-29 09:27:22 -08:00
|
|
|
};
|
|
|
|
|
2014-11-21 17:27:11 +03:00
|
|
|
static jint get_compilation_activity_mode() { return _should_compile_new_jobs; }
|
2010-01-29 09:27:22 -08:00
|
|
|
static bool should_compile_new_jobs() { return UseCompiler && (_should_compile_new_jobs == run_compilation); }
|
|
|
|
static bool set_should_compile_new_jobs(jint new_state) {
|
|
|
|
// Return success if the current caller set it
|
|
|
|
jint old = Atomic::cmpxchg(new_state, &_should_compile_new_jobs, 1-new_state);
|
2018-05-30 14:46:17 +02:00
|
|
|
bool success = (old == (1-new_state));
|
|
|
|
if (success) {
|
|
|
|
if (new_state == run_compilation) {
|
|
|
|
_total_compiler_restarted_count++;
|
|
|
|
} else {
|
|
|
|
_total_compiler_stopped_count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return success;
|
2010-01-29 09:27:22 -08:00
|
|
|
}
|
2013-10-10 15:44:12 +02:00
|
|
|
|
|
|
|
static void disable_compilation_forever() {
|
|
|
|
UseCompiler = false;
|
|
|
|
AlwaysCompileLoopMethods = false;
|
2017-09-26 21:37:01 +02:00
|
|
|
Atomic::xchg(jint(shutdown_compilation), &_should_compile_new_jobs);
|
2013-10-10 15:44:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool is_compilation_disabled_forever() {
|
2017-07-12 09:49:05 +02:00
|
|
|
return _should_compile_new_jobs == shutdown_compilation;
|
2013-10-10 15:44:12 +02:00
|
|
|
}
|
2014-09-17 08:00:07 +02:00
|
|
|
static void handle_full_code_cache(int code_blob_type);
|
2013-11-12 09:32:50 +01:00
|
|
|
// Ensures that warning is only printed once.
|
|
|
|
static bool should_print_compiler_warning() {
|
|
|
|
jint old = Atomic::cmpxchg(1, &_print_compilation_warning, 0);
|
|
|
|
return old == 0;
|
|
|
|
}
|
2007-12-01 00:00:00 +00:00
|
|
|
// Return total compilation ticks
|
|
|
|
static jlong total_compilation_ticks() {
|
|
|
|
return _perf_total_compilation != NULL ? _perf_total_compilation->get_value() : 0;
|
|
|
|
}
|
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
// Redefine Classes support
|
|
|
|
static void mark_on_stack();
|
|
|
|
|
2015-10-08 12:49:30 -10:00
|
|
|
#if INCLUDE_JVMCI
|
|
|
|
// Print curent compilation time stats for a given compiler
|
|
|
|
static void print_times(AbstractCompiler* comp);
|
|
|
|
#endif
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// Print a detailed accounting of compilation time
|
2015-10-08 12:49:30 -10:00
|
|
|
static void print_times(bool per_compiler = true, bool aggregate = true);
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
// Debugging output for failure
|
|
|
|
static void print_last_compile();
|
|
|
|
|
2013-03-19 07:23:29 -07:00
|
|
|
// compiler name for debugging
|
|
|
|
static const char* compiler_name(int comp_level);
|
2013-06-10 11:30:51 +02:00
|
|
|
|
2018-04-18 11:19:32 +02:00
|
|
|
// Provide access to compiler thread Java objects
|
|
|
|
static jobject compiler1_object(int idx) {
|
|
|
|
assert(_compiler1_objects != NULL, "must be initialized");
|
|
|
|
assert(idx < _c1_count, "oob");
|
|
|
|
return _compiler1_objects[idx];
|
|
|
|
}
|
|
|
|
|
|
|
|
static jobject compiler2_object(int idx) {
|
|
|
|
assert(_compiler2_objects != NULL, "must be initialized");
|
|
|
|
assert(idx < _c2_count, "oob");
|
|
|
|
return _compiler2_objects[idx];
|
|
|
|
}
|
|
|
|
|
|
|
|
static CompileLog* get_log(CompilerThread* ct);
|
|
|
|
|
2018-05-30 14:46:17 +02:00
|
|
|
static int get_total_compile_count() { return _total_compile_count; }
|
|
|
|
static int get_total_bailout_count() { return _total_bailout_count; }
|
|
|
|
static int get_total_invalidated_count() { return _total_invalidated_count; }
|
|
|
|
static int get_total_native_compile_count() { return _total_native_compile_count; }
|
|
|
|
static int get_total_osr_compile_count() { return _total_osr_compile_count; }
|
|
|
|
static int get_total_standard_compile_count() { return _total_standard_compile_count; }
|
|
|
|
static int get_total_compiler_stopped_count() { return _total_compiler_stopped_count; }
|
|
|
|
static int get_total_compiler_restarted_count() { return _total_compiler_restarted_count; }
|
|
|
|
static int get_sum_osr_bytes_compiled() { return _sum_osr_bytes_compiled; }
|
|
|
|
static int get_sum_standard_bytes_compiled() { return _sum_standard_bytes_compiled; }
|
|
|
|
static int get_sum_nmethod_size() { return _sum_nmethod_size;}
|
|
|
|
static int get_sum_nmethod_code_size() { return _sum_nmethod_code_size; }
|
|
|
|
static long get_peak_compilation_time() { return _peak_compilation_time; }
|
|
|
|
static long get_total_compilation_time() { return _t_total_compilation.milliseconds(); }
|
2014-10-30 18:38:42 -04:00
|
|
|
|
|
|
|
// Log that compilation profiling is skipped because metaspace is full.
|
|
|
|
static void log_metaspace_failure();
|
2018-03-26 12:59:45 -07:00
|
|
|
|
|
|
|
// CodeHeap State Analytics.
|
|
|
|
static void print_info(outputStream *out);
|
|
|
|
static void print_heapinfo(outputStream *out, const char* function, const char* granularity );
|
2007-12-01 00:00:00 +00:00
|
|
|
};
|
2010-11-23 13:22:55 -08:00
|
|
|
|
|
|
|
#endif // SHARE_VM_COMPILER_COMPILEBROKER_HPP
|